Monday, February 1, 2016

MethodOverRiddingExample2

package methodOverridding;

public class MethodOverRiddingExample2 extends MethodOverRiddingExampe1{

public void test1(){
System.out.println("I am from child  class");
}

public static void main(String[] args) {

MethodOverRiddingExample2 obj = new MethodOverRiddingExample2();

obj.test1();

/**
* At run time method will be called based on the class for which we have
* created object.
*/


}

}

1 comment:

  1. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.

    Core Java Training in Electronic city

    ReplyDelete