3. Give the output of the following code if value of opn='b'
switch(opt)
{
case 'a':
System.out.println("Platform independent");
case 'b':
System.out.println("Object Oriented”);
case 'c':
System.out.println("Robust and Secure");
break;
Answers
Answered by
1
Output:
Object Oriented
Robust and Secure
Explanation:
As value is 'b', control will go to case 'b' and will fall-through to case 'c' as break; statement is missing in case 'b'.
Answered by
1
Answer:
Output:
Object Oriented
Robust and Secure
It is because after case 'b' there is no 'break' keyboard...
I hope you find it useful... If you have any query ask in comments I will try to solve it...
Similar questions