Advertisement
markov5534

Untitled

Nov 18th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class animalClass {
  4.     public static void main(String[] args) {
  5.         Scanner scanner=new Scanner(System.in);
  6.         System.out.print("What animal? :");
  7.         String jivotno= scanner.nextLine();
  8.  
  9.         switch (jivotno){
  10.             case "dog":
  11.                 System.out.println("The dog is mammal");
  12.             case "snake":
  13.                 System.out.println("The snake is reptile");
  14.             default:
  15.                 System.out.println("Unknown class animal");
  16.         }
  17.  
  18.  
  19.  
  20.  
  21.     }
  22.  
  23.  
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement