Tag Archives: OCJP

Unit 2 (Prog 6) : Test Static Keyword

By | June 9, 2013

This article covers basics of static keyword, static methods and static variables. /*  * STATIC METHODS :  * 1. Static method can not access non-static (Instance) variable or method.  * 2. Static method can not be overridden they are redefined.  */ 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 1 (Concept 1) : Access Modifiers in java

By | June 2, 2013

Visibility of the properties  of class for different access modifiers  ——————————————————————————————————————– 1) From the same class           Public , Protected, Private and Default 2) From any class in same package           Public, Protected and Default 3) From a subclass in same package          … 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 »