Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class RabbitTester {
- public static void main(String[] args) {
- Rabbit bunny = new Rabbit("Peter", 10);
- System.out.println(bunny);
- bunny.snack();
- System.out.println(bunny);
- bunny.eatMeal(4);
- System.out.println(bunny);
- bunny.raidGarden(5);
- System.out.println(bunny);
- bunny.changeName("Flopsy");
- System.out.println("new name is " + bunny.getName());
- bunny.getCaught();
- System.out.println("carrots = " + bunny.getCarrots());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement