Friday, September 19, 2014

Constructor inheritance(ovveriding) and reasons behind restricting constructor inheritance in Java.

Inheritance is one the key concept of OOP. Being object oriented language, Java supports it. With inheritance every Child becomes a Parent. You can access the properties of Parent from a Child once you inherit Parent (using extends keyword). Here is a key point to note that, though you can access the members of Parent you cannot inherit/ or override constructor in Java.

Friday, August 29, 2014

Reason - Why Object as super class in Java ?

The Object class is the base for Java Language and we all reading the below sentences from day one of our Java Programming.

Every class is a Child of the Object class.
Every class in Java extends Object class.
Object class is the super class of every Java Class.

Thursday, July 24, 2014

Multiple Inheritance in Interfaces supports in Java.

We all know that Java won't support multiple inheritance to avoid diamond problem. So there is no way of extending multiple classes in java. That ends the discussion about multiple inheritance in classes. But still Java allows multiple inheritance in Interfaces. That raises the question about the same diamond problem in Interface as well right?