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