Catch Non Existent Exception - Java Object Oriented Design

Java examples for Object Oriented Design:Exception

Description

Catch Non Existent Exception

Demo Code

public class Main {
  public static void main(String[] args) {
    int x = 10, y = 0, z = 0;
    try {//from  w w w. ja v a 2 s  .  co  m
      z = x / y;
    } catch (Exception e) {
      // Handle the exception
    }
  }
}

Related Tutorials