-
Notifications
You must be signed in to change notification settings - Fork 0
/
Animal.java
44 lines (35 loc) · 857 Bytes
/
Animal.java
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
public class Animal {
private String name;
private int brain;
private int body;
private int size;
private int weight;
public Animal(String name, int brain, int body, int size, int weight) {
this.name = name;
this.brain = brain;
this.body = body;
this.size = size;
this.weight = weight;
}
public void eat() {
System.out.println("Animal.eat() called");
}
public void move(int speed) {
System.out.println("Animal.move() is called. Animal is moving at speed " + speed);
}
public String getname() {
return name;
}
public int getBrain() {
return brain;
}
public int getBody() {
return body;
}
public int getSize() {
return size;
}
public int getWeight() {
return weight;
}
}