-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMagicNarwhal.java
More file actions
41 lines (33 loc) · 1004 Bytes
/
Copy pathMagicNarwhal.java
File metadata and controls
41 lines (33 loc) · 1004 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
public final class MagicNarwhal extends Narwhal
{
private int age;
private int horn;
public MagicNarwhal()
{
super("Magic Narwhal", "It's a domesticated, slightly less chubby sea dog.");
}
@Override
public String play()
{
return "It doesn't want to play. The fact that you domesticated it makes it sad.";
}
@Override
public String makeNoise()
{
return "This narwhal is magic and therefore has gained intelligence equivalent /n" +
"to that of a 32 year old human." +
"/n" +
"/n" +
"Ah, and I forgot to mention that it doesn't want to make noise. It thinks it rude.";
}
@Override
public String swim()
{
return "Because it is magic, this narwhal no longer swims. It /n" +
"pierces through the water with its unicorn horn and jumps out of the water..." +
"/n" +
"/n" +
"/n" +
"And starts to fly.";
}
}