从 W3Schools.cn 在线教程学习 Web 网络开发
运行结果尺寸: 625 x 591
MyClass.java
 


public class MyClass {
  public static void main(String[] args) {
    try {
      int[] myNumbers = {1, 2, 3};
      System.out.println(myNumbers[10]);
    } catch (Exception e) {
      System.out.println("Something went wrong.");
    }
  }
}


Result:
Something went wrong.