Posts

Showing posts from August, 2014

Inheritance,its requirement,use and implementation

Image
Inheritance Inheritance example:a tree Inheritance is the most interesting feature of java and other Object oriented programming language.It is the only reason why i hate "C". Firstly,lets know what inheritance is??As the word suggest means taking the features....but of what??A class or an interface.But what are the features???The variables and the method the class or interface contains. Inheritance takes the principle of re usability.Using the previously written code for a class without rewriting it again. Just extend the class,that's it.The class which is taking the feature of another class is called child class and the class from which features are taken is called parent or base class. It per the rules of humanity that child cannot be born parents,thus child class constructor is executed after the parent class constructor by default(discussed later). Remember single class can extend single class through inheritance. Requirement No one likes to rewrit