In the last post we discussed about method overriding. In this post we will see how to do exception handling for overriding and overridden methods…. [Read More]
Difference between method Overloading and Overriding in java
In this tutorial we will discuss the difference between overloading and overriding in Java. If you are new to these terms then refer the following… [Read More]
Method overriding in java with example
Declaring a method in sub class which is already present in parent class is known as method overriding. Overriding is done so that a child… [Read More]
Java – Constructor in Interface?
This is a most frequently asked java interview question. The answer is No, interface cannot have constructors. In this post we will discuss why constructors… [Read More]
Java – Constructor Chaining with example
Calling a constructor from the another constructor of same class is known as Constructor chaining. The real purpose of Constructor Chaining is that you can… [Read More]
Java – private constructor example
The use of private constructor is to serve singleton classes. A singleton class is one which limits the number of objects creation to one. Using… [Read More]
Multilevel inheritance in java with example
When a class extends a class, which extends anther class then this is called multilevel inheritance. For example class C extends class B and class… [Read More]
Hierarchical Inheritance in java with example program
When more than one classes inherit a same class then this is called hierarchical inheritance. For example class B, C and D extends a same… [Read More]
hybrid inheritance in java with example program
A hybrid inheritance is a combination of more than one types of inheritance. For example when class A and B extends class C & another… [Read More]
Constructor Overloading in Java with examples
Like methods, constructors can also be overloaded. In this guide we will see Constructor overloading with the help of examples. Before we proceed further let’s… [Read More]