Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1.  
  2. package tta2001_fourth;
  3.  
  4.  
  5. public class TTA2001_Fourth {
  6.  
  7.  
  8. public static void main(String[] args) {
  9. Animal animal= new Animal();
  10. animal.isHuman();
  11.  
  12. Animal animal2 = new Animal(2);
  13. animal2.isHuman();
  14. }
  15.  
  16. }
  17.  
  18.  
  19. class Animal{
  20. int tail = -1;
  21.  
  22.  
  23. Animal(){
  24.  
  25. }
  26. Animal(int tail){
  27. this.tail= tail;
  28. }
  29.  
  30. void isHuman()
  31. {
  32. if(tail!=-1){
  33.  
  34. System.out.println("NOt Humman");
  35. }
  36. else{
  37. System.out.println("Human");
  38.  
  39. }
  40. }
  41.  
  42.  
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement