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

what is CSharp

6 Answers  


How do you generate documentation from the C# file commented properly with a command-line compiler?

1 Answers  


Can you change the value of a variable while debugging a C# application?

1 Answers   Wipro,


what is dynamic sql

2 Answers   TCS, Wipro,


How can we main a Class as base class,i.e not inherited further?{please Dont tell using Sealed class,any other way}

6 Answers   IBM, Tech Mahindra, ACB Group,






why instance? what are the uses of instance?

3 Answers   Choice Solutions,


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

1 Answers   CTS, Microsoft,


1. Describe page life cycle?

0 Answers   Steria, Mphasis,


3. Describe the process of interact UI to BAL n DAL?

2 Answers   Mphasis,


code for arranging given number in possible permutation ways ex:123,321,312,132,231,213.

0 Answers  


how can we pass parameters to a user control using delegates ?

1 Answers   IBM,


I have a class declared as below public class a { public void add() {} } What is the diference between a a1 =new a; and simply a a1;

3 Answers  






Categories