Wish to have some nice time? Check out what I'm reading online!

What is an abstract class?

April 14th, 2008

A class containing atleast one abstract method is called an abstract class. A method that has no implementation and which is expected to be implemented by a subclass is called an abstract method. An Abstract class cannot be instantiated. It is expected to be extended by a subclass. An abstract class may contain static variables declared. Any class with an abstract method must be declared explicitly as abstract. A class may be declared abstract even if it has no abstract methods. This prevents it from being instantiated.

This site is very good and simple. I do have a question here. The first line says – “A class containing atleast one abstract method is called an abstract class” –

Isn’t it incorrect?

However in the last line you have mentioned clearly that abstract class may not have an abstract method.

regards,
prasanth

Prasanth on May 20th, 2010 10:35 am

The abstract class may or may not have the abstract method. But if you have any abstract method then the class should be Abstract.

UnKnown on June 30th, 2010 11:36 pm

1. A class containing atleast one abstract method is called an abstract class.

2. A class may be declared abstract even if it has no abstract methods.

?????…

Anonymous on July 6th, 2010 10:03 am





hidden and gravatar enabled.