From the course: Programming Foundations: Object-Oriented Design

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Objects

Objects - Python Tutorial

From the course: Programming Foundations: Object-Oriented Design

Start my 1-month free trial

Objects

- The idea behind object-oriented computing is that it makes thinking about and discussing programming similar to thinking about the real world. So to ask what's an object in a computer program, start by asking, what's an object in the real world? - So is this cookie an object? - Sure. - What about this mug? - Absolutely. These are both objects, they're things. - What about this mug? Are these two mugs the same object? - No, although they're similar mugs, they're not the same mug. These are separate objects, each with its own existence. It's own identity that's independent of all other objects. Every object has characteristics, inherent properties that describe its current state. For example, a mug can be full, empty, or somewhere in between. Filling one mug with coffee does not mean all of the mugs in the world get filled. The current state of this mug being full is independent of this other empty mug because they're separate objects. - But there's more to a mug on whether it's empty…

Contents