能的。因为System.out.println这个方法永远不会抛出InvalidKeyException这个异常,所以catch里的代码永远也不会被执行,IndexOutOfBoundsException 在操作数组时可能会抛出,所以没什么问题。
对,exception是所有异常的父类