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

how to add datarow to datatable

1 Answers  


What is piller of OOPS in C#.

10 Answers  


how to implement singelton in C# & its uses?

1 Answers   TCS,


what is used ref keyword in c#,and how we used it?

2 Answers  


destructor, Dispose, Finalize - How they relate to each other

1 Answers   Synechron,






the selected inf of other combobox?How do you achieve it?

1 Answers   CTS, Microsoft,


Where test director stores its data ? Database ,Local file etc...? I need to read this data from Visual Studio 2005 c# client. Regards

0 Answers  


What happens in synchronisation?

2 Answers   Tech Mahindra,


Hoe can i connect the table into the c# application?

2 Answers  


How do you inherit from a class in C#?

1 Answers  


What does Dispose method do with the connection object?

2 Answers  


Are private class-level variables inherited?

5 Answers   HCL, Visual Soft,






Categories