What will be the output of the program?class BoolArray { boolean [] b = new boolean[3]; int count = 0; void set(boolean [] x, int i) { x[i] = true; count; } public static void main(String [] args) { BoolArray ba = new BoolArray(); ba.set(ba.b, 0); ba.set(ba.b, 2); ba.test(); } void test() { if ( b[0] && b[1] | b[2] ) count ; if ( b[1] && b[( count - 2)] ) count = 7; System.out.println('count = ' count); } } - Study24x7
Social learning Network
study24x7

Default error msg

Login

New to Study24x7 ? Join Now
Already have an account? Login
22 Feb 2023 12:43 PM study24x7 study24x7

What will be the output of the program?class BoolArray { boolean [] b = new boolean[3]; int count = 0; void set(boolean [] x, int i) { x[i] = true; ++count; } public static void main(String [] args) { BoolArray ba = new Boo...

See more

A

count = 0

B

count = 2

C

count = 3

D

count = 4

study24x7
Write a comment
Related Questions
500+   more Questions to answer
Most Related Articles