Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Solution {
- public static void main(String[] args) {
- int x = 0;
- while(x <= 0)
- x++;
- switch(x) {
- default:
- System.out.println("default does not have to be at the start");
- case 0: {
- System.out.println("x is 0");
- System.out.println("x is 0");
- }
- case 1:
- System.out.println("x is 1");
- System.out.println("x is 1");
- case 2: {
- System.out.println("There was no break statement so this prints too!");
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement