Can we have an Abstract class without having any abstract method ??

 Posted by Pradsir on 2/18/2011 | Category: OOPS Interview questions | Views: 8198 | Points: 40
Answer:

Yes we can have Abstract class without having any abstract method ..

See the code below
using System;

abstract class A
{
public void Hello()
{
Console.WriteLine(" Say Hi");
}
}

class B:A
{
}

class Demo
{
public static void Main()
{
B b1 = new B();
b1.Hello();
}
}
// Output is Say HI


the class A is abstract class.. but it does not have any abstract methods..

Thanks


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response

More Interview Questions by Pradsir