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 virtual 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
}






Trace the O/p for a program on inheritance and Polymorphism. 3 classes A,B,C A with two method..

Answer / payal

call B's SomeMethodA
Call A's SomeMoreMethodA
call C's SomeMethodA
call C's SomeMoreMethodA

Is This Answer Correct ?    1 Yes 0 No

Post New Answer




More C Sharp Interview Questions

When you inherit a protected class-level variable, who is it available to?

5 Answers   CMC, IBM,


What?s an interface class?

5 Answers   Mind Tree,


WHAT IS THE DIFFERENCE BETWEEN STRING AND STRING BUILDER ?

3 Answers  


I wish to create a windows application to perform a similar function as that of the "Search" which is provided to look for related files and folders in the System.. What steps must i follow??

0 Answers  


what does static void Main(string[] args) in C# mean????????

5 Answers   ssinformatics,






Can multiple catch blocks be executed?

4 Answers   Visual Soft,


Can a structure inherit a class.

3 Answers   Infosys, Synechron,


Which is algorithm is used to Manage the Memory in .net ??

7 Answers   TCS,


how do you do exception management

4 Answers   HCL, Accenture,


What is the name of the implicit input parameter of a set accessor for any property?

1 Answers   TCS,


This is Kishore i am MCA graduate i have percentage less(52%) in my 10th still i completed .NET course any body tell me how to put fake experience with my BSC degree if you do not mind tell me some fake certificates giving consultencies names in Chennai,Bangalore

5 Answers  


What is Serialization and how do we implement (in real time scenario)

1 Answers  






Categories