thenewboston

Java Programming Tutorial - 12 - Switch Statement

Aug 22nd, 2014
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. public class apples {
  2.    public static void main(String args[]){
  3.       int age;
  4.       age = 3;
  5.      
  6.       switch (age){
  7.       case 1:
  8.          System.out.println("You can crawl");
  9.          break;
  10.       case 2:
  11.          System.out.println("You can talk");
  12.          break;
  13.       case 3:
  14.          System.out.println("You can get in problem");
  15.          break;
  16.       default:
  17.          System.out.println("I don't know how old you are");
  18.          break;
  19.       }
  20.    }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment