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

}

Answers were Sorted based on User's Feedback



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

Answer / vibz

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

Is This Answer Correct ?    7 Yes 2 No

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

Answer / kanan

Vibz answer is correct at some level. but i am thinking
different way.

Call to class B's SomeMethodA
Call to class A's SomeMoreMethodA
Call to class C's SomeMethodA <-- our answers differ here
Call to class C's SomeMoreMethodA

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More C Sharp Interview Questions

Write down the c# syntax to catch an exception

1 Answers  


What are delegates in C#?

1 Answers   Winsol Solutions,


Can class be protected in c#?

1 Answers  


What does get set mean in c#?

1 Answers  


Why do we need constructor in c#?

1 Answers  


How do I do implement a trace?

1 Answers  


What is a static in c#?

1 Answers  


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

1 Answers  


What is array and arraylist?

1 Answers  


Which program construct must return a value?

1 Answers   3i Infotech,


How you will handle session when deploying application in more than a server? Describe session handling in a webform, how does it work and what are the limits?

3 Answers   Microsoft,


Can properties be static in c#?

1 Answers  


Categories