-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDuck.java
More file actions
50 lines (42 loc) · 1.03 KB
/
Copy pathDuck.java
File metadata and controls
50 lines (42 loc) · 1.03 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
public class Duck extends Animal implements Running, Swimming
{
private int cuteness;
public Duck(int cuteness)
{
//super comes first in the constructor
super("Duck",
"A yellow furball with eyes and orange beak and feet");
this.cuteness = cuteness;
}
public Duck(int cuteness, String name, String desc)
{
super(name, desc);
this.cuteness = cuteness;
}
@Override
public String play()
{
return "This duck likes to waddle";
}
@Override
public String eat()
{
return "It eats grapes";
}
@Override
public String makeNoise()
{
return "It says got any grapes" + cuteness + " times.";
}
@Override
public String swim()
{
return "It swims in a lemonade pond";
}
@Override
public String run()
{
return "It runs as quickly as it can waddle away\n" +
"from the lemonade stand 'till the very next day.";
}
}