Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is run time polymorphism

Answer Posted / vijayakumar chinnasamy

In Java Method overriding is the runtime or late binding
polymorphism.

class object is determine which class method is invoked.

ex:

class A {
protected void display(){ }

}

class B extends A {

protected void display(){ }

}

class MainClass {
public static void main(String arg[]){

A objA=null;
objA=new B();
objA.display(); // it invoke the Class B's display()

objA=new A();
objA.display(); // it invoke the Class A's display()

}

}

Note: the class's object only determine which method to call.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is string args [] in java?

1031


How to solve the problem of generating the unique hash keys with hash function?

1913


What is an association?

981


What is the significance of continue jump statement? Explain with an example.

1289


What is use of functional interface in java 8? Explain

1015


Can we force the garbage collection to run?

947


Which collections are thread safe in java?

923


Can a final variable be manipulated in java?

979


What’s the difference between callable and runnable?

1098


Can we have static methods in an interface?

1050


Why is java called the platform independent programming language?

1004


Define linked list and its features with signature?

996


how to handle exceptions in ejb?

2304


Why do we need singleton?

963


What are the important features of Java 8 release?

1082