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
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