Day10
- Finally: In exception handling, the code that is placed in the finally is the code that is bound to be executed. Typically used to close a resource.
- try{};finally{} can exist, in which case no catch is an exception that is not handled and must be declared if the exception is not a run-time exception.
- The exception is reflected in the child parent class overlay: When a subclass overrides a parent class, if a method of the parent class throws an exception, the child class's overriding method can only throw the exception of the parent class or the subclass of the exception. If the parent class method has multiple exceptions, the child class can only throw a subset of the parent exception when it overrides the method. That is, if the parent class or interface does not throw an exception, then the child class overrides the method, and the exception cannot occur, and if an exception occurs, it must be processed in the subclass.
- Package: The class file is categorized and managed. Provides a multilevel namespace for a class. Write in the first line of the program file. The name of the class is the package name. Class name. Packages are also a form of encapsulation.
Beginners To learn Java, is javase, every day I learn from the day and notes, I hope you can criticize and advice, and promote common progress! Ten!