forked from techreturners/oop_java_exercises
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCatImpl.java
42 lines (34 loc) · 860 Bytes
/
CatImpl.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
package com.techreturners.cats;
public abstract class CatImpl implements Cat { // implements cat interface
private boolean sleeping;
private int height; // doesn't need to match int in LionCat
private String type;
private String eatingNoise;
// constructor
public CatImpl( String eatingNoise ) {
this.eatingNoise = eatingNoise;
this.sleeping = false;
}
@Override
public Boolean isAsleep() {
return this.sleeping;
}
@Override
public Boolean goToSleep() {
this.sleeping = true;
return sleeping;
}
@Override
public void wakeUp(){
this.sleeping = false;
}
public String getSetting (){
return "";
}
public int getAverageHeight(){
return height;
}
public String eat() {
return eatingNoise;
}
}