Showing posts with label Inheritance. Show all posts
Showing posts with label Inheritance. Show all posts

Tuesday, 21 January 2014

Using final with Inheritance

how to use final apply to inheritance.

Using final to Prevent Overriding


While method overriding is one of Java’s most powerful features.To disallow a method from being overridden,specify final as a modifier at the start of its declaration.

MULTILEVEL HIERARCHY IN JAVA PROGRAMMING

MULTILEVEL HIERARCHY


Creating multilevel hierarchy in java

In simple inheritance a subclass or derived class derives the properties from its parent class, but in multilevel inheritance a subclass is derived from a derived class. One class inherits only single class. Therefore, in multilevel inheritance, every time ladder increases by one. The lower most class will have the properties of all the super classes’.

INHERITANCE BASICS

Basics of Inheritance in java

How to use extends keyword to inherit the super class

Inheritance is one of the key feature of Object Oriented Programming.There are three types of inheritance in java,they are Single Inheritance,Multilevel Inheritance and Hierarchical Inheritance.Inheritance provided mechanism that allowed a class to inherit property of another class.When a class extends another class it inherits all non-private members including fields and methods.For class inheritance, Java uses the keyword extends.