Removing breaks

Report a typo

Here's a part of a Java program with the switch statement.

What is the value of num if we remove both break keywords?

char ch = 'a';
int num = 0;
switch(ch) {
    case 'a':
        num = 10; 
        break; 
    case 'b':
        num = 20;
        break; 
    default: 
        num = 30;
}
Select one option from the list
___

Create a free account to access the full topic