title: in java programming use a scanner class along with switch case statement using numbers
body: <p>Can anybody tell me how to use "switch-case" for numbers along with scanner class, so that a number read from the keyboard should compare with switch cases given and final output should be printed?                                                          </p>
  
  <pre><code>import java.util.Scanner;
  public class Switchcase{
  public static void main(String[] args) {
  
      int age;
      Scanner bhavya = new Scanner(System.in);
      System.out.println("enter your age:");
      age = bhavya.nextInt();
      switch (age) {
          case 1:
              System.out.println("you can crawl");
              break;
          case 2:
              System.out.println("you can talk");
              break;
          case 3:
              System.out.println("you can get in trouble");
              break;
          default:
              System.out.println("i dnt know how old you are");
              break;
      }
  }
  </code></pre>