The difference between runtimeexception and checked exception:
1. There are two types of errors: Throwable two species of Errow and Exception
Exception errors caused by the encoding:
e.g:
int b=0;
int a=5/b;
System.out.println (a);
2.try Catch Finally catch exception
Put code that might appear to be abnormal, put it in a try
catch (Exception e) {}
Finally is the final meaning, whatever it is, it will be executed.
e.g:
public static void Main (string[] args) {//when input is incorrect
do{
Scanner input=new Scanner (system.in);
System.out.println ("Please enter a number:");
try{
int A=input.nextint ();
SYSTEM.OUT.PRINTLN ("You have entered the correct" +a);
Break
}catch (Exception e) {//error type when run
SYSTEM.OUT.PRINTLN ("Input error, please re-enter");
}
finally {
System.out.println ("1");
}
}while (TRUE);
}
3.throw and Thows differences
Throw throws the object throw A; Exception a=new Exception)
throws throws a declaration e.g throws Exception
4. Check for exceptions, when used, require a try catch exception
5. Exception rewriting
Overrides throw exceptions that are smaller than the parent class or are the same as the default and parent classes
Still follow exception handling when the main method is executed
The above are all small knowledge, * * *
On exceptions in Java