Monday, March 28, 2011

Java abstract methods

An abstract method is a method that's been declared as abstract but not implemented, so, the method contains no functional code.

It is illegal to have an abstract method in a class that is not explicitly declared abstract.

The first concrete subclass of an abstract class must implement all abstract methods of the superclass.

Abstract and static modifiers are NOT allowed. The compiler will output such error:

SomeClass.java:37: illegal combination of modifiers: abstract and
static
abstract static void doMethod();

No comments:

Post a Comment