Objects
Objects are the basic key to understand object-oriented programming. Programming objects are just like real-world objects. Look around, you'll see many objects. Your car, mobile phone, desk, laptop, pet dog, and DVD player are all objects.
All objects have two characteristics: properties and methods.
A mobile has properties (color, screen size, height, and weight) and methods (make calls, send SMSs, receive calls, and transfer files).
A car has properties (color, height, gearbox, wheels, engine, brakes, and steering) and methods (start engine, steer, change gear, apply brake, stop, and crash).
Just like these real-world examples, the objects in OOP have the same characteristics. So, an object, in terms of programming, can have properties (variables ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access