Write a switch statement that switches on an integer variable named val. If val is 2 or 15, then output "Hello World." For all other values, output "Goodbye World."

What will be an ideal response?

```
switch(val) {
case 2:
System.out.println("Hello World!");
break;
case 15:
System.out.println("Hello World!");
break;
default:
System.out.println("Goodbye World!");

}
```

Computer Science & Information Technology

You might also like to view...

The field ________ defines the maximum length of data within a field

A) piece B) section C) size D) row height

Computer Science & Information Technology

Briefly describe BitLocker to Go.

What will be an ideal response?

Computer Science & Information Technology