![]() ![]() Note that a class can exist without an object but vice-versa is not possible. Note that classes are not considered as a data structure. it binds data and functions together in a single unit. Inside a class, we define variables, constants, member functions, and other functionality. ClassĪ class is a blueprint or template of an object. Different objects have different states or attributes, and behaviors. It contains member functions, variables that we have defined in the class. It is referred to as an instance of the class. OOPs ConceptsĪn object is a real-world entity that has attributes, behavior, and properties. A person plays an employee role in the office, father and husband role in the home. The above figure best describes the concepts of polymorphism. It allows the developer to create clean, sensible, readable, and resilient code. It allows us to create methods with the same name but different method signatures. The word polymorphism is derived from the two words i.e. The concept allows us to inherit or acquire the properties of an existing class (parent class) into a newly created class (child class). A class is the best example of encapsulation. It protects data and functions from outside interference and misuse. There are the following advantages of abstraction:Įncapsulation is a mechanism that allows us to bind data and functions of a class into an entity. Using the concept developer can easily make changes and added over time. The concept allows us to hide the implementation from the user but shows only essential information to the user. There are four pillars on which OOP rests. The major concepts that we have discussed above are known as pillars of OOPs. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |