Abstract class without any abstract method

Viewed 17130

I am surprised to know that an abstract class in C# is possible with no abstract methods also.

abstract class AbstractDemo
{
 public void show()
  {
    Console.WriteLine("In Show Method"); 
   }
}
class MainDemo:AbstractDemo
{
 public static void Main()
 {
    Console.WriteLine("In Main Method");
 }
}

Any explaination ?

8 Answers

We have heard that in abstract class, there must be an abstarct member. But when I compile the abstarct class without an abstract method, it compiles. It gives me surprise. Now I am unable to find the article which explain exact behavior of an abstarct class.

Related