![]() ![]() Polymorphism is an important concept of OOPs. The parent class is called the base class or superclass and the child class that extends the base class is called the derived class or subclass or child class. In simpler words, this concept develops the parent-child relationship between two classes. As the name suggests, in this concept one object acquires the properties and behaviors of the other parent class. There are as followsĪnother important and interesting concept of OOPs is inheritance. Method\Behavior: Open door, close door If we want to write a class based on states and behaviors of the House we have to. Objects have two characteristics, states, and behaviors. It is a bundle of data and its behavior is known as methods. In a program, multiple instances of a class are present. Real-world substances like laptops, mobiles, cars, tables, chairs, etc. Its properties/data/variable/attribute can be price, speed of the cars and the methods/functions can be like driving, reverse, braking, and so on of the car. Suppose “expensive cars” is a class and for this class, the objects will be Mercedes, BMW, Toyota, and so on. ![]() It is easier to understand this with the help of an example. It is a logical component or entity and not a physical entity. In simpler words, it is a group of variables and functions. ![]() Some of the important concepts that are required to know in OOPs are as follows: What is Class in OOPSĪ class can be described as a blueprint with a group of similar entities, through which various objects can be created. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |