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

What is the use of static members with example using c#.net.

0 Answers  


What is the use of GC.KeepAlive Method?

0 Answers   HCL,


How can I make sure my c# classes will interoperate with other .net languages?

0 Answers  


Explain how do you directly call a native function exported from a dll?

0 Answers  


What is the use of list in c#?

0 Answers  






Is array passed by reference in c#?

0 Answers  


What are the main reasons to use c# language?

0 Answers  


What is the major difference between a custom control and user control?

0 Answers   C DAC, CDAC,


What does it meant to say “the canonical” form of XML ?

1 Answers  


What is escape character in c#?

0 Answers  


how to handle errors in sqlserver

1 Answers  


Are enums static c#?

0 Answers  


Categories