Classes in java.util * Import. ; public class ExceptionTest { public static void main (String [] args) { int A, B, C; Scanner Re = new new Scanner (the System. in ); . the System OUT .println ( " Please enter the divisor " ); A = re.nextInt (); . the System OUT .println ( " Please enter the dividend " ); B = re.nextInt (); the try { C = A / B; . the System OUT .println (C); } The catch(Exception T) { t.printStackTrace (); . The System OUT .println ( " dividend zero " ); } the finally { . The System OUT .print ( " Program Continuation " ); } } }
The sixth exception handling job training
Guess you like
Origin www.cnblogs.com/lijiawei123/p/10985971.html
Ranking