-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOgre.java
More file actions
42 lines (36 loc) · 950 Bytes
/
Copy pathOgre.java
File metadata and controls
42 lines (36 loc) · 950 Bytes
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
public class Ogre extends Animal implements Running
{
private String color;
private int weight;
public Ogre(String color, int weight)
{
super("Ogre", "A man-eating giant.");
this.color = color;
this.weight = weight;
}
public Ogre(String name, String description, String color, int weight)
{
super(name, description);
this.color = color;
this.weight = weight;
}
@Override
public String makeNoise()
{
return "It says 'Arrrrgh, I'm going to eat you!'";
}
@Override
public String eat()
{
return "It devours human flesh ravenously.";
}
@Override
public String play()
{
return "The ogre runs around wildly, swinging its heavy axe.";
}
public String run()
{
return "The " + color + ", " + weight + "-lb ogre runs, thumping the floor with every step.";
}
}