Java SE 8 Programmer I (1Z0-808)
© examsiri.com
Question : 7 of 8
Marks:
+1,
-0
Given the code fragment:
What is the result?
public class Test {
 public static void main(String[] args) {
 int x = 10;
 int y = 2;
 try {
  for (int z = 2; z >= 0; z--) {
   int ans = x / z;
   System.out.print(ans+ " ");
  }
 } catch (Exception e1) {
   System.out.println("E1");
 } catch (ArithmeticException e1) {
   System.out.println("E2");
  }
 }
}What is the result?
Go to Question: