Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What are the key principles of object-oriented programming (OOP)?
The main key principles of object-oriented programming (OOPs) are as follows: Encapsulation. Inheritance. Polymorphism. Abstraction or Data hiding. 1. Encapsulation It is the concept of object-oriented programming language, in which we are wrapping code and data together into single unit. ItRead more
The main key principles of object-oriented programming (OOPs) are as follows:
1. Encapsulation
It is the concept of object-oriented programming language, in which we are wrapping code and data together into single unit. It is basically to hide data from other class object.
For example – Every schoolboy carry a water bottle, here water is a data. Water is encapsulated in bottle. It is safe from contamination, to use this water (data), we must to open the cap of the bottle by the standard method only. Compare this with the water in the pond or well, there is no fixed method to use it and not be safe.
2. Inheritance
It is the concept in OOPs in which we can inherit the property, attributes, methods from one class to another class. The class from which we can inherits the methods is called parent class. The class that inherits the property from parent class is called child class.
For example – Such as bike, car or bus is come under the category in vehicles so they inherit the property from parent class called class vehicles.
3. Polymorphism
Here, “Poly” means “many” and “morphism” means “forms”. It means a single function or method can perform many different types of forms.
For example – A man, who at the same time can perform in different characters, such as a father, a husband, and an employee at the same time.
4. Abstraction
It is the concept in OOPs in which only showing the essential data or details and hiding the non-essential data to the user.
For example – In real life, we are using different type of machines in which we don’t know the internal function of the machines, and know only the external function of the machines that interact by the users.
What are the key principles of object-oriented programming (OOP)?
The main key principles of object-oriented programming (OOPs) are as follows: Encapsulation. Inheritance. Polymorphism. Abstraction or Data hiding. 1. Encapsulation It is the concept of object-oriented programming language, in which we are wrapping code and data together into single unit. ItRead more
The main key principles of object-oriented programming (OOPs) are as follows:
1. Encapsulation
It is the concept of object-oriented programming language, in which we are wrapping code and data together into single unit. It is basically to hide data from other class object.
For example – Every schoolboy carry a water bottle, here water is a data. Water is encapsulated in bottle. It is safe from contamination, to use this water (data), we must to open the cap of the bottle by the standard method only. Compare this with the water in the pond or well, there is no fixed method to use it and not be safe.
2. Inheritance
It is the concept in OOPs in which we can inherit the property, attributes, methods from one class to another class. The class from which we can inherits the methods is called parent class. The class that inherits the property from parent class is called child class.
For example – Such as bike, car or bus is come under the category in vehicles so they inherit the property from parent class called class vehicles.
3. Polymorphism
Here, “Poly” means “many” and “morphism” means “forms”. It means a single function or method can perform many different types of forms.
For example – A man, who at the same time can perform in different characters, such as a father, a husband, and an employee at the same time.
4. Abstraction
It is the concept in OOPs in which only showing the essential data or details and hiding the non-essential data to the user.
For example – In real life, we are using different type of machines in which we don’t know the internal function of the machines, and know only the external function of the machines that interact by the users.