try { int c = stringToInt(a); int d1 = stringToInt(b); System.out.println(c * d1); } catch (NumberFormatException e) { System.out.println("Number not Format");} catch (Exception e) { System.out.println(e); }
说错了,是捕获异常
catch (Exception e) { System.out.println("以外错误!!!"); }
还不忘加上 这个 点赞
Sign in to make a reply
jasmine