1. The difference between abstract and generic classes:
1) abstract class using the abstraction modifier
2) Abstract classes cannot be instantiated
3) Abstract classes can have abstract methods, or there can be no abstract method
2.-Use interface statement
-Interfaces are a collection of abstract methods and constants, and no other components
-the method in the interface is decorated as public abstract by default
-The default decoration for constants in an interface is public static final
-Implement interface using implements keyword
-A class can implement multiple interfaces, with multiple interfaces separated by commas
-Interfaces can inherit between
-If a class implements both an interface and a parent class, extends is placed in front of implements
3. How to create an inner class object outside the class:
-For non-static inner classes: You must first create an outer class object, and then create an inner class object
-For static inner classes: The inner class is decorated with static, so the object that creates the class can have no external class object
4. Throw an exception after the method parameter list using the throws keyword declaration, the exception is not processed inside the current method, and the method that calls the current method is thrown
5.-Throws can declare multiple exceptions to be thrown separated by commas, with multiple exceptions without order
-Can declare the parent class of the exception class that throws the occurrence
-overriding methods cannot throw exceptions that are larger than overridden methods (non-runtime exceptions)
6. Custom Exceptions:
-Typically inherited runtimeexception
-function: See the meaning of the name
-Usually you need to use the throws keyword to throw
java_day05 Java Basics