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...

Trace the O/p for a program on inheritance and Polymorphism.

3 classes A,B,C

A with two methods

public virtual SomeMethodA

public virtual SomemoreMethodA

B:A
overide virtual SomeMethodA

C:B
new Method SomeMethodA

override SomeMoreMethodA

main method
{
b new instance of B
b.SomeMethodA
b.SomeMoreMethodA

b1 new instance of C
b1.SomeMethodA
b1.SomeMoreMethodA
}

Answer Posted / payal

call B's SomeMethodA
Call A's SomeMoreMethodA
call C's SomeMethodA
call C's SomeMoreMethodA

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between gettype and typeof in c#?

845


Can you put two constructor with the same structure in a class?

866


Can a private virtual method can be overridden?

934


Are enums static c#?

916


Which attribute adorn a test class to be picked up by the NUnit GUI in the NUnit test framework?

949


Is unboxing an implicit conversion?

954


Explain the difference between proc. Sent by val and by sub?

878


What is polymorphism in c sharp?

922


What is the base class of all classes in c#?

948


What is a thread? What is multithreading?

892


What is class method c#?

849


Which constructor is called first in c#?

883


Why do you need boxing in c#?

846


Are c# tuples immutable?

872


When would you use generics in your code c#?

867