package Library; import java.util.Scanner; import java.util.Arrays; public class shuming extends Exception { public static void main(String[] args) { String [] book=new String[]{"Thank in Java","Head First In Java","C pro"}; System.out.println(Arrays.toString(book)); try { Scanner inqut=new Scanner(System.in); int name = inqut.nextInt(); } catch (Exception e) { String one=e.getMessage(); System.out.println(one); } } }
请问这里调用getMessage()方法输出的时候 我明明输入一段字符串 为什么输出结果是null 空??
getmessage不应该输出异常信息吗?为什么我不能输出异常信息
巫山有云兮
Jason333
相关分类