Category Archives: overriding

Polymorphism in Java

By | March 30, 2014

This article contains… What is Polymorphism ? Reference variable types and Object Example of Polymorphism Runtime and Compiletime Polymorphism Example of both SCJP exam objective 5.2

Unit 8 (Prog 1) : Test Inner Class

By | June 11, 2013

In this example, you will find the concept of Inner class in java, how to declare and access the inner class properties. Access modifiers and their effect on inner class properties. Java doc for Inner class in given Here : Inner class in java

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 4) : Test Overloading and Overriding

By | June 3, 2013

Overloading v/s Overriding methods… class Operator {           public int operation(int x, int y) {                     System.out.println(“First method invoked from parent class.”);                     return x + y;           }… Read More »

Unit 2 (Prog 3) : Test equals() method.

By | June 2, 2013

Testing of equals() method and overriding equals() method of Object class. // Overriding equals() method will make an object identical // to use a object as a key, one has to override equals() method of Object class   public class EqualsTest {           public static void main(String[] args) {    … Read More »