Abstract class:
Classes that are decorated with the abstract keyword are called abstract classes. An abstract class cannot be instantiated, that is, it cannot be new to an abstract class object
Abstract method: Methods that are modified by using the abstract keyword are called abstract methods
1. Abstract method, there is a declaration, no implementation, the method behind the semicolon can not be saved;
2. Abstract methods need to be defined in abstract classes, compared to abstract methods, the previously defined methods are called concrete methods (declarations, implementations);
If a class contains an abstract method, then the class must be an abstract class.
If a class is an abstract class, then the class can contain concrete methods (declarations, implementations);
If a class contains an abstract method, the class must be declared as abstract class, that is, the class must be an abstraction, and conversely, if a class is an abstract class, then the class can contain either abstract or concrete methods
In either case, as long as a class is an abstract class, the class cannot be instantiated
In cases where a subclass inherits the parent class (the parent class is an abstract class), the subclass must implement all the abstract methods defined in the parent class, otherwise the subclass declares an abstract class
Package Com.yuanzijian02;public class Test {public static void main (string[] args) {}}abstract class T {public abstract Vo Id method ();p ublic void Test () {System.out.println ("Test");}} Class R extends t{public void method () {System.out.println ("test"); }}
8.
Java object-oriented abstract class