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 usage of transponders?

0 Answers   Wipro,


What is the ouput of the following program?

0 Answers  


Explain about Error handling and how this is done

0 Answers   Digital GlobalSoft,


What is an array class?

0 Answers  


Is for loop faster than foreach?

0 Answers  


How do you create partial methods?

0 Answers  


How do I use the 'using' keyword with multiple objects?

0 Answers  


Is array passed by reference in c#?

0 Answers  


What do constructors do in c#?

0 Answers  


What is cache memory in c#?

0 Answers  


What is the function of the not null constraint?

0 Answers  


You are designing a user control. You created new property called backgroundimage which is of type image. You wanted to disable storing this property in the user’s form. How to achieve this?

0 Answers  


Categories