Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

try catch java

public class MyClass {
  public static void main(String[ ] args) {
    try {
      int[] myNumbers = {1, 2, 3, 4, 5, 6};
      System.out.println(myNumbers[10]);
    } catch (Exception e) {
      System.out.println("Something went wrong. check again");
    }
  }
}
 
 
PREVIOUS NEXT
Tagged: #catch #java
ADD COMMENT
Topic
Name
9+3 =