Tag Archives: inheritance

Java 8 : Default method in Interface

By | March 31, 2014

This article contains… What is Default methods ? Why Default methods ? Example of various scenarios using Default methods Default methods and multiple inheritance Behavior when extending interface. email

email

Unit 2 (Prog 5) : Constructors in java

By | June 5, 2013

Constructor Demo code… /*  * 1. Constructor can use any return type.  * 2. Constructor name must match the name of class.  * 3. constructor must not have a return type.  * 4. If you see a method with return type having same name as class than it is just a method.  * 5. if… Read More »

Unit 2 (Prog 1) : Test Inheritance of class in JAVA

By | June 1, 2013

Inheritance Test for OCJP preparation… /*  * equals() method is defined under  * java.lang.Object class which is inherited by all class having main method  *  * thus every class is instance of java.lang.Object class  * Whenever you create a class, you automatically inherit all of class Object’s methods.  */ public class ch21TestClassInheritance {    … Read More »