A Java Program Attempting to Divide an Integer by Zero - Java Language Basics

Java examples for Language Basics:int

Description

A Java Program Attempting to Divide an Integer by Zero

Demo Code

public class Main { 
  public static void main(String[] args) {
    int x = 10, y = 0, z;
    z = x/y;    //from ww w.  ja  va  2  s  .  c  om
    System.out.println("z = " + z);
  }
}

Related Tutorials