Fundamentals of OOP
An OOPs Language has a few essential characteristics. Without these characteristics, we cannot call a programming language an OOPs language. These characteristics are also called the principles of Objective Oriented Programming. The characteristics are as follows:
- Encapsulation
- Data Abstraction
- Polymorphism
- Inheritance
Let's look at the characteristics in detail.
Encapsulation
Encapsulation is an information hiding mechanism. It combines both code and data together. Encapsulation is used to hide the values of an object inside a class. It prevents an unauthorized section of code from accessing the code directly. Before discussing encapsulation any further, let's look at a simple example. Look at the following code:
class AddNumbers ...
Get Learning C for Arduino now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.