MCQOPTIONS
Saved Bookmarks
| 1. |
What is the output of this program?public class Exec_Handling_Example { public static void main(String args[]) { try { int k, n; n = 5; for (k = -2; k < 2 ;++k) { n = (n / k); System.out.print(k); } } catch(ArithmeticException e) { System.out.print("0"); } } } |
| A. | -1 0 |
| B. | 0 -1 |
| C. | 0 |
| D. | 1 |
| E. | None of these |
| Answer» B. 0 -1 | |