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 do you meant by Runtime Polymorphism?

Answers were Sorted based on User's Feedback



What do you meant by Runtime Polymorphism?..

Answer / pankajbisane

Runtime polymorphisms means the code is called at run time
according to need or given conditions.

suppose there r two methods namely Add() one in super class
and other is in sub class.both have the same name and same
parameters.

so we have to choose that which method from them should
called at run time i.e. of super class or of sub class.

It can be achieved through the use of virtual functions.

Is This Answer Correct ?    1 Yes 0 No

What do you meant by Runtime Polymorphism?..

Answer / swe

In runtime polymorphism ... the code is called at run time according to need or given conditions.

suppose there r two methods namely Add() one in super class and other is in sub class.both have the same name and same parameters.

so we have to choose that which method from them shld called at run time i.e. of super class or of sub class.by polymorphism we do that.

ex:-

class A

{

int add(){//code of the method}

//some other code

}

class B extends A

{

int add(){//code of the method}

//some other code

}

class AB

{

public static void main(String s[])

{

A ob1;

ob1 new A();

int i ob1.add();//will call the method of super class.

ob1 new B();// sub class's reference can be assigned to super class address but not vice versa.to do that we have to type cast the reference of the sub class in reference of the super class.

int j ob1.add();//will call the method of sub class

}

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More Programming Languages AllOther Interview Questions

Write a program to find duplicate number from array in minimum time complexity.

0 Answers   Genpact,


Write a program to read and print a text file on screen

1 Answers   Peerless,


in IT trend mantis meant what? how to know mantis in IT trends? detail description about mantis?

0 Answers   Sacred Heart College,


how to fin top two miximum values in sql? not 2nd both max value of 1st and 2nd both have to find out

0 Answers  


what is the difference between an OS(operating system) and Framework?

0 Answers  


Caret means to you

1 Answers  


i want to improve my english vocab for racking campus written exam plz tell me best book for prepration......

0 Answers  


differences between qtp10.0 and 11.0 ?

0 Answers  


What do you mean by an array ? explain with an example

7 Answers  


What are the Advantages of HashMap over Vector?

1 Answers  


why not instantiating servet using new operator?

0 Answers  


in a VB application, where the data will be stored after manipulation? what is the syntax for that?

0 Answers   TCS,


Categories