This week we learned about anomalies, assertions. When we are not in touch with this chapter, we will be in the process of running the program also some errors, sometimes prompted, use the time without prompting. So an exception is created, and if the program appears in error, an exception is thrown, which interrupts the program. Exceptions are classified into fatal and non-fatal exceptions. All exceptions are throwable inherited, and the next layer is divided into error and exception. Throw an exception with the throw new ... can also be written in the method header, with throws. Creating an exception requires only that you define a class that derives the exception or that derives from the exception subclass. The catch exception must use the try{},catch{} statement, either to catch an exception or to catch multiple exceptions.
The assertion is for the debugger to be able to quickly and easily check for program exceptions, but Java is not enabled by default, so open the assert "switch" in the settings,-ea. Assertions are primarily used during code development and testing, to judge certain critical data, and if the key data is not the data your program expects, the program warns or exits. By doing experimental work can feel the anomalies and assertions in the code of the existence of the program, if you need to master or more practice. As opposed to the previous content, it seems that there is no particular abstraction that can be understood.
"Java Programming" (9)