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
}



Trace the O/p for a program on inheritance and Polymorphism. 3 classes A,B,C A with two method..

Answer / 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

More C Sharp Interview Questions

What is the difference between out and ref in c#?

0 Answers  


Difference between ByVal and ByRef?

5 Answers   Microsoft,


What is difference between singleton and static class in c#?

0 Answers  


Which are the access modifiers available in c#?

0 Answers  


What is the use of ispostback in c#?

0 Answers  


What is the difference between list and array in c#?

0 Answers  


Is c# strongly typed?

0 Answers  


Is null c# operator?

0 Answers  


what are the benefits in using c# ?

1 Answers  


What is the difference between list and dictionary in c#?

0 Answers  


List the fundamental oop concepts?

0 Answers  


What are the valid parameter types we can pass in an Indexer ?

3 Answers   CMC,


Categories