Abstract classes can be used to implement the inheritance relationship between the classes that belongs same hierarchy.
- Classes and methods can be declared as abstract.
- Abstract class can extend only one Class.
- If a Class is declared as abstract , no instance of that class can be created.
- If a method is declared as abstract, the sub class gives the implementation of that class.
- Even if a single method is declared as abstract in a Class , the class itself can be declared as abstract.
- Abstract class have at least one abstract method and others may be concrete.
- In abstract Class the keyword abstract must be used for method.
- Abstract classes have sub classes.
- Combination of modifiers Final and Abstract is illegal in java.
The general form of abstract class is :
abstract type name (parameter list);
The
Sample Abstract Classes: HttpServlet, GenericServlet
You can more avout Interface here
Click here for Difference between Abstract class and Iterface
Number
class in the java.lang
package represents the abstract concept of numbers. It makes sense to model numbers in a program, but it doesn't make sense to create a generic number object.Sample Abstract Classes: HttpServlet, GenericServlet
You can more avout Interface here
Click here for Difference between Abstract class and Iterface
No comments:
Post a Comment