Tuesday, January 23, 2007

Abstract class ?

An abstract class can never be instantiated. Its sole purpose is to be extended. There should be atleast one abstract method in an abstract class.

abstract methods end in a semi colon. They only declare the methods but contain no body for the method. A concrete subclass of an abstract class must implement all the methods in the subclass.

. abstract class must bs declared as absrtact using "abstract" key word.
. abstact class can't be instantiated.
. may not contain abstract method ie its not necessary to have abstarct method in abstract class.
. class which extends abstract class must implement all the abstract methods in the abstract class else should be declared as abstract class.

SOURCE : www.referjava.com

No comments: