Advertisement
Guest User

Untitled

a guest
Aug 30th, 2015
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. public class Cases{
  2. public static void main(String args[]){
  3. float x = 9;
  4. float y = 5;
  5. int z = (int) (x / y);
  6. switch (z) {
  7. case 1:
  8. x = x + 2;
  9. case 2:
  10. x = x + 3;
  11. default:
  12. x = x + 1;
  13. }
  14. System.out.println("Value of x: " + x);
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement