Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void testStringSwitch(String s)
- {
- String str = s.toLowerCase();int i = -1; switch (str.hashCode()) {case 49: if (str.equals("1")) i = 0; break; case 50: if (str.equals("2")) i = 1; break; case 51: if (str.equals("3")) i = 2; break; case 2112: if (str.equals("BB")) i = 4; else if (str.equals("Aa")) i = 3; break; } switch (i) {
- case 0:
- case 1:
- case 2:
- System.out.println(s);
- break;
- case 3:
- case 4:
- System.out.println(s.toUpperCase());
- break;
- default:
- System.out.println(s);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement