-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dinosaur.java
57 lines (47 loc) · 1 KB
/
Dinosaur.java
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
import java.util.List;
/**
* Write a description of class Dinosaur here.
*
* @author (Joanna Wan)
* @version (a version number or a date)
*/
public class Dinosaur extends Animal implements Roamable
{
/**
* Constructor for objects of class Dinosaur
*/
public Dinosaur(String name, String description)
{
super(name, description);
}
@Override
public String roam()
{
return "RAAAAAAAAAAWWWWWWRRRRRRRRRRRR";
}
@Override
public String makeNoise()
{
return "RAAAAAAAAAAWWWWWWRRRRRRRRRRRR";
}
@Override
public String sleep()
{
return "zzzzZZZzz";
}
@Override
public String play()
{
return "The dinosaur plays with an egg.";
}
@Override
public String eat()
{
return "The dinosaur cracks open an ostrich egg and eats it";
}
@Override
public String move()
{
return "The dinosaur runs around the tree.";
}
}