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 a boolean field?

939


What is this keyword in java?

1018


Is multiple inheritance supported by java?

967


What is length in java?

1001


Why for each loop is used?

997


What is a function in java?

1000


How many bits are used to represent unicode, ascii, utf-16, and utf-8 characters?

1081


How to sort an unsorted array in java?

1112


How many bits is a string?

973


What is numeric function?

982


What are the different http methods?

1013


what is the difference between process and thread? : Java thread

967


Write a program to print count of empty strings in java 8?

982


What is a constructor, constructor overloading in java?

981


How can I become a good programmer?

962