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

Explain the differences between static, void and public in c#?

0 Answers  


What does assert() do?

1 Answers   Wipro,


What is the xml document structure?

0 Answers  


Classes and structs can be declared as static, is this statement true or false?

0 Answers  


What is use of abstract class in c#?

0 Answers  


What is file extension of webservices?

0 Answers  


What is ienumerator c#?

0 Answers  


Why do we need ienumerable in c#?

0 Answers  


Assignment # 1 Print the pattern given below using single printf statement XX XX XX XX XX XX X X X X XX XX XX XX XX XX Assignment # 2 Print the pattern given below using single printf statement (please do NOT use the string function below) 0 909 89098 7890987 678909876 56789098765 4567890987654 345678909876543 23456789098765432 1234567890987654321

3 Answers   Wipro,


Who benefits from ajax?

0 Answers  


How does substring work in c#?

0 Answers  


What statements can enclose a "continue" statement?

3 Answers   Fortech,


Categories