![]() With inheritance, we can reuse the fields and methods of the existing class. Just like a child inherits the traits of his/her parents. ![]() Inheritance facilitates reusability and is an important concept of OOPs. So, a same person posses different behavior in different situations. Like a man at a same time is a father, a husband, a employee. It is the ability of a message to be displayed in more than one form. The word polymorphism means having many forms. What is Encapsulation? Answer:Įncapsulation is a principle of wrapping data (variables) and code together as a single unit.Įncapsulation is like your bag in which you can keep your pen, book etc.Įncapsulation means hiding the internal details of an objectĮncapsulation is a technique used to protect the information in an object from the other object 6. Just as Real-world objects have its state and behavior Software objects too have state and behavior.Ī software object maintains its state in variables and implements its behavior with methods. Software objects are modeled after real-world objects such as a pen, keyboard, chair, table, computer, Book etc. It has its own state, behavior, and identity. ![]() What is an object? Answer:Īn object is an instance of a class. A class is a blueprint, or prototype which defines and describes the member attributes and member functions. A class is a template from which objects are created. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |