For newbies, learning object-oriented programming might be a challenge. Encapsulation, inheritance, and polymorphism are three of the most common ways that new programmers are introduced to OOP. The trouble is that once you understand the origins of these notions, they become quite easy to grasp. Where are the roots?
In object-oriented programming, your program will be split into several small, manageable, reusable programs. Each small program has it’s own identity, data, logic and how it’s going to communicate with the rest of the other small programs.
So what is an object? How about a class?
Objects
When you think about objects, you should consider real-life scenarios. Object-Orientation was created to bring it closer to reality, making it simpler and more realistic.
What are the Objects? Well, Objects could be:
- Something visible for you, like the car, phone, apple, duck, lamp.
- Something that you can’t touch, like the Time, Event, Account.