-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathKangaroo.java
More file actions
75 lines (66 loc) · 1.6 KB
/
Copy pathKangaroo.java
File metadata and controls
75 lines (66 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import java.util.List;
import java.util.ArrayList;
/**
* Write a description of class Kangaroo here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Kangaroo extends Animal implements Roamable
{
private List<String> toys;
/**
* Constructor for objects of class Kangaroo
*/
public Kangaroo(String name, String description, String toy)
{
super(description, name);
toys = new ArrayList<String>();
toys.add(toy);
}
public Kangaroo()
{
super("A genetically engineered kangaroo who was the result of a military experiment conducted by " +
"Doctor Gepetto Bosconovitch while under employment of the Mishima Zaibatsu in Tekken 2.", "Roger");
toys = new ArrayList<String>();
toys.add("Boxing gloves");
}
public String roam()
{
return "The kangaroo jumps around very happily.";
}
@Override
public String makeNoise()
{
return "BRAARAAAWRAAAARR";
}
@Override
public String sleep()
{
return "zzzzzzzzz";
}
@Override
public String play()
{
String playing = "";
for(String toy : toys)
{
playing += "Roger puts his "+ toy +" and compete in Iron Fist Tournament";
}
return playing;
}
@Override
public String eat()
{
return "Roger eats the grasses and drink human blood";
}
@Override
public String move()
{
return "Roger backflips and beats his bongo.";
}
public List<String> getToys()
{
return toys;
}
}