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

Give few difference between constructor and method?

1023


Is null or empty java?

1030


Can variables be used in java without initialization?

1124


What are the three parts of a lambda expression?

1061


How to restrict a member of a class from inheriting by its sub classes?

1388


What is the symbol for space?

1042


What is length in java?

1057


Write a java program to generate fibonacci series ?

1102


What is a singleton in genetics?

1128


How are the elements of a gridbaglayout organized in java programming?

1025


What is stringbuffer in java?

1112


Can we create a class inside a class in java?

1148


Which java collection does not allow null?

1211


Differentiate between array list and vector in java.

1155


Differentiate between static and non-static methods in java.

1096