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.
*/
}
}
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.
*/
}
}
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.
ReplyDeleteCore Java Training in Electronic city