Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class AnimalType {
  3. public static void main(String[] args) {
  4. Scanner sc =new Scanner(System.in);
  5. String animal = sc.nextLine();
  6. switch (animal){
  7. case dog:
  8. System.out.println("mammal");
  9. break;
  10. case crocodile:
  11. case tortoise:
  12. case snake:
  13. System.out.println("reptile");
  14. break;
  15. default:
  16. System.out.println("unknown");
  17. }
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement