Java For Android Tutorial #8: Arithmetic Exception / by zero



Code:
public class java {
    public static void main(String[] str) {
        try{
int i = 10/0;
        }
        catch(Exception e){
            System.out.println("You are dividing the number by 0 in line A");
        }
    }
}

Comments

Popular Posts