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

Why we can't create the object of abstract class ?

15 Answers   CTS, HCL, L&T, IBM, Assyst,


all information

1 Answers  


how can i get this 123456789 1234 6789 123 789 12 89 1 9

1 Answers   Excel,


I have a very important query in my mind. Please help me regarding this. I don't have any real time exp in .net. But I have a knowledge it .net. I got an offer from an MNC company as a software developer has I had kept 2 years of fake exp. Even though for this job I had worked hard to crack interview for about an year. So, I would like to know how difficult it will be for working in real time as I don't have real time exp. Please tell me as soon as possible bcoz I need to join by next month. Can i sustain over there for a longer time or not. And also let me know how to work pressure will be over there. Please help me regarding this. I'm getting tension thinking about it. Thank you.

1 Answers  


How will U encapsulate button trigger event into text_box event of Pressing Enter key?

3 Answers   TCS,






why C# called C#

3 Answers  


What are the different generaions of Garbage Collection and how do they work

4 Answers  


Is array reference type / value type ?

6 Answers   Accenture,


5. What properties we used to call stored procedure in C#?

2 Answers   Mphasis,


Practcle scenario where I can use abstract class and where I can use Interface

1 Answers   Jeevan Technologies,


Explain about throw keyword?

10 Answers   Emphasis, Satyam, HCL,


What is a private constructor? where will you use it?

6 Answers   Fulcrum Logic,






Categories