-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathAnimalNoise.java
More file actions
44 lines (29 loc) · 960 Bytes
/
AnimalNoise.java
File metadata and controls
44 lines (29 loc) · 960 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
43
44
import model.Example;
import model.Lion;
import model.Parrot;
import model.Binturong;
public class AnimalNoise {
public static void main(String[] args) {
Example example = new Example();
System.out.println(example.makeNoise());
/*
*
* Add a call to your animal below this comment.
*/
// Creating an instance of the Parrot class
Parrot parrot = new Parrot("Green", "Amazon Parrot", 12);
//instantiating the binturong
Binturong binturong = new Binturong("male", 25, "Black");
// Printing the result of the makeNoise method from the Parrot class
System.out.println(parrot.makeNoise());
//binturong go moo
System.out.println(binturong.speak());
//New instance of Lion class
Lion myLion = new Lion("Adult", "Male", 200);
//Making noise:
System.out.println(myLion.makeNoise());
//create timberwolf object
Timberwolf t = new Timberwolf("Grey", 4, "Male");
System.out.println(t.makeNoise());
}
}