![]() The concept of inheritance is also known as re-usability or extendable classes or sub classing or derivation. **The data members and methods of a class are known as features. **The class which is taking the data members and methods is known as sub or derived or child class. **In the inheritance the class which is give data members and methods is known as base or super or parent class. By doing this, we are reusing the fields and methods of the existing class. when we want to create a new class and there is already a class that includes some of the code that we want, we can derive our new class from the existing class. **Reusability: Inheritance supports the concept of “reusability”, i.e. The subclass can add its own fields and methods in addition to the superclass fields and methods. **Sub Class: The class that inherits the other class is known as subclass(or a derived class, extended class, or child class). **Super Class: The class whose features are inherited is known as superclass(or a base class or a parent class). It is the mechanism in java by which one class is allow to inherit the features(fields and methods) of another class. Inheritance=> Inheritance is an important pillar of OOP(Object Oriented Programming). Object-Oriented Programming is a methodology or pradigm to design a program using classes and objects Objects=> Any Entity that has state and behaviour is known as a object.Examples are Chair,Pen,Table etc.Ĭlass=> Class is a Collection of objects.It is a Logical Entity.So, Class is a Definition of object,template for objects, and object is an instance of a class. ![]() Let us consider the above oop concepts one by one. Java Is an Object-Oriented Programming language.Everything in Java is associated with class and objects,along with it's attributes and methods.Classes and Objects are two main aspects of object-oriented programming. OOP Stands for Object-Oriented Programming.Object-Oriented Programming is paradigm that provides many concepts,such as inheritance,polymorphism etc.It simplifies software development and maintenance by providing some concepts.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |