-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathGorilla.java
More file actions
57 lines (45 loc) · 1.22 KB
/
Gorilla.java
File metadata and controls
57 lines (45 loc) · 1.22 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
51
52
53
54
55
56
57
/**
* @author Isaac Roetman - ijroetman
* CIS175 - Spring 2023
* Jan 17, 2023
*/
package model;
public class Gorilla {
private String habitat;
private String name;
private double weight;
public Gorilla() { //default constructor
}
public Gorilla(String habitat, String name, double weight) { //constructor with parameters setting values
super();
this.habitat = habitat;
this.name = name;
this.weight = weight;
}
//getters and setters
public String getHabitat() {
return habitat; //returns habitat
}
public void setHabitat(String habitat) {
this.habitat = habitat; //sets habitat
}
public String getName() {
return name; //returns name
}
public void setName(String name) {
this.name = name; //sets the name
}
public double getWeight() {
return weight; //returns weight
}
public void setWeight(double weight) {
this.weight = weight; //sets the weight
}
public String makeNoise() {
return "Ummm-ummm!"; //returns the noise
}
@Override
public String toString() { //override toString method printing the information of the Gorilla
return "Gorilla [habitat =" + habitat + ", name =" + name + ", weight =" + weight + "lbs]";
}
}