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

Diff b/w casting and boxing

4 Answers   Wipro,


What is wcf c#?

0 Answers  


What’s difference between Association, Aggregation and Inheritance relationships?

2 Answers   TCS,


hi In my database i put id column as identity(the database is incremented by it self only)what i want is if i enter a data in my website, id will come automatically can u pl z tell me the code thax in advance

1 Answers  


What are the 2 kinds of data type conversions in c#?

0 Answers  






What?s the C# equivalent of C++ catch (?), which was a catch-all statement for any possible exception?

1 Answers  


What is difference between throw and throws in c#?

0 Answers  


Difference between value and reference type. What are value types and reference types?

0 Answers  


Which types of inheritances does c# support?

0 Answers  


What is Wrapper class in dot net?

0 Answers   HCL,


Why is c# better than java?

0 Answers  


What operator means?

0 Answers  


Categories