Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Java Catching base and child exception classes

class Main {
  public static void main(String[] args) {
    try {
      int array[] = new int[10];
      array[10] = 30 / 0;
    } catch (Exception | ArithmeticException | ArrayIndexOutOfBoundsException e) {
      System.out.println(e.getMessage());
    }
  }
}
Comment

PREVIOUS NEXT
Code Example
Java :: initialize set of strings java 
Java :: java this keyword 
Java :: java two constructors 
Java :: super class and concrete class in java 
Java :: is type java 
Java :: how to add data json jaca 
Java :: if en une seul ligne java 
Java :: java private keyword 
Java :: Java Integer Literals 
Java :: adding matrix 
Java :: Java (HotSpot 12) sample 
Java :: In similar fashion we will use (RIGHT – SHIFT) to retrieve bits from val 6 at a time 
Java :: java 11 read file line by line 
Java :: Java byte Keyword 
Java :: converting amount into millions nad billions Java 
Java :: for loop in firebase snapshot in java 
Java :: How to Fix java.lang.UnsupportedClassVersionError 
Java :: Converting data in java 
Java :: what does the continue keyword do in java 
Java :: boolean parse jtextfield 
Java :: java @documented 
Java :: java code to input non blank string 
Java :: cypher query having multiple values 
Java :: inputstream to bufferedreader 
Java :: place.getlatlng() returning null 
Java :: HashMap to Pojo 
Java :: public void bookingDetails(View view) { Intent intent = new Intent (PackageContext:this, MainActivity.class); intent.putExtra("name", value "kenny"); startActivity(intent); } 
Java :: javafx get listview fxml id 
Java :: how to code the overdraft limit in Java 
Java :: java change time to hh:mm:ss format 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =