MCQOPTIONS
Saved Bookmarks
| 1. |
What is the output of this program? class access { public int x; private int y; void cal(int a, int b) { x = a + 1; y = b; } } class access_specifier { public static void main(String args[]) { access obj = new access(); obj.cal(2, 3); System.out.println(obj.x + " " + obj.y); } } |
| A. | 3 3 |
| B. | 2 3 |
| C. | Runtime Error |
| D. | Compilation Error |
| Answer» D. Compilation Error | |