Logo 
Search:

C# Forum

Ask Question   UnAnswered
Home » Forum » C#       RSS Feeds

Output for Abstract Class

  Asked By: Claude    Date: May 29    Category: C#    Views: 1210
  

I have following assignment, Can anyone say what could be the output of this program.

class Class1
{
static void Main(string[] args)
{
Foo b1 = new Bar();
b1.Response();
Console.ReadLine();
}
}
abstract class Foo
{
public virtual void Response()
{
Console.WriteLine("In Foo");
}
}
class Bar : Foo
{
public override void Response()
{
Console.WriteLine("In Bar");
}
}

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Sophie Williamson     Answered On: May 29

I found it,

Output is: In Bar

 
Didn't find what you were looking for? Find more on Output for Abstract Class Or get search suggestion and latest updates.
This post is locked for further answers.




Tagged: