Advertisement
markov5534

Untitled

Nov 18th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 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. break;
  13. case "snake":
  14. System.out.println("The snake is reptile");
  15. break;
  16. default:
  17. System.out.println("Unknown class animal");
  18. break;
  19. }
  20.  
  21.  
  22.  
  23.  
  24. }
  25.  
  26.  
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement