Public class TestMain {public static void main (String [] args) {AbstractTest. out ();}}
Public class TestMain {public static void main (String [] args) {AbstractTest. out ();}}
The above program can be run.
Understanding: In general, abstract classes can contain abstract and non-Abstract METHODS. Static classes can only contain static members, and all static members can only be included in static classes.
Static methods include abstract and sealed, so static methods can be included in abstract classes and used by abstract class name. static method. Because static data includes the sealed feature, it cannot be inherited.
In this way, you can avoid using methods in the parent class by instantiating objects in its subclass because the abstract class cannot be instantiated. You can directly write the methods as static methods, you can implement the method without the subclass of the abstract class.