main.java - /* * To change this license header, choose...

This preview shows page 1 out of 1 page.

/** To change this license header, choose License Headers in Project Properties.* To change this template file, choose Tools | Templates* and open the template in the editor.*/package test;import java.util.Scanner;/**** @author TUAN*/public class main {public static int divideByZero(int a, int b){// this statement will cause ArithmeticException(/ by zero)return a%b;}/*** @param args the command line arguments*/public static void main(String[] args) {try{double n;Scanner sc = new Scanner(System.in);
End of preview. Want to read the entire page?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
NoProfessor
Tags
Logic, Return statement, main function, Command line argument

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture