Computer Science, asked by bbbala2305, 4 months ago

What will be the output of the program?
int i = 1, j = -1;
switch (i)
{
case 0, 1: j = 1; /* Line 4 */
case 2: j = 2;
default: j = 0;
}
System.out.println("j = " + j);

Answers

Answered by farhan8346
1

Answer:

error

Explanation:

If below given was the program then its output is j=0.

int i = 1, j = -1;

switch (i)

{

case 0: j = 1; /* Line 4 */

case 1: j = 1;

case 2: j = 2;

default: j = 0;

}

System.out.println("j = " + j);

Similar questions