Exception Throwable
Sub-category Error, Exception
Error-cannot be processed
Exception-Targeted treatment
Principle
Throw throws for custom exception exception classes
Check for syntax errors first, and then check for logic errors
The custom exception is either captured or declared
Classification of exceptions
1, compile-time is detected exception: exception and its subclasses, except RuntimeException
2. No exception detected at compile time (runtime exception): RuntimeException and its subclasses
Throws and throw differences
1, throws use on the function
Throw is used in the function.
2, throws thrown is an exception class, you can throw multiple, separated by commas
Throw throws an exception object
Exception capture Try Catch
try{//code that needs to be detected exception}
catch (Exception class variable) {
Code to handle exceptions
}
finally{//is bound to be executed code}
E.printstacktrace ();
Object class--equals method
Native Local methods
Hashcode method
Integer.tohexstring ();
GetClass method
Byte-code file object
. getName
ToString Method
GetClass (). GetName () + "@" + hashcode ()
Java Day 11