| 1. | What will be the output of the program? class BoolArray void set(boolean [] x, int i) public static void main(String [] args) void test() |
|||||||
Answer: Option C Explanation: The reference variables b and x both refer to the same boolean array. count is incremented for each call to the set() method, and once again when the first if test is true. Because of the && short circuit operator, count is not incremented during the second if test. |
