Advertisement
Guest User

Untitled

a guest
Jan 29th, 2020
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1. public class RabbitTester {
  2.    
  3.     public static void main(String[] args) {
  4.        
  5.         Rabbit bunny = new Rabbit("Peter", 10);
  6.         System.out.println(bunny);
  7.        
  8.         bunny.snack();
  9.         System.out.println(bunny);
  10.        
  11.         bunny.eatMeal(4);
  12.         System.out.println(bunny);
  13.        
  14.         bunny.raidGarden(5);
  15.         System.out.println(bunny);
  16.        
  17.         bunny.changeName("Flopsy");
  18.         System.out.println("new name is " + bunny.getName());
  19.        
  20.         bunny.getCaught();
  21.         System.out.println("carrots = " + bunny.getCarrots());
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement