Abstract class and abstract method
In this scjp tutorial you will learn about the abstract class and abstract method.
In this scjp tutorial you will learn about the abstract class and abstract method.
Some key points about abstract methods are as following
- An abstract modifier identifies abstract classes and methods
- An abstract methods cannot be private because it defined in the other
class.
- An abstract methods cannot be final.
- An abstract methods ends with a semicolon with no curly braces.
- An abstract methods may have parameters, a return type and throws
clause.
Some key points about abstract methods are as following
- An abstract class may or may not necessary to have all methods abstract,
it may have non abstract method also.
- An abstract class cannot be instantiated so it need to be a sub class of
a concrete class.
- A single abstract method must exists in a abstract class. A concrete
class cannot hold abstract method.
- An abstract class is meant to be used as the base class from which other
classes are derived.
The above concept can be viewed in examples provided in next page.