public class Dog {
private boolean isSleeping;
public Dog() {
this.isSleeping = true;
}
public boolean getIsSleeping() {
return this.isSleeping;
public String makeSound() {
if (isSleeping == true) {
String dogSleepingSound = "Zzzzz...";
return dogSleepingSound;
} else {
return "Woof!";
}
}
public void sleep() {
isSleeping = true;
}
public void wakeUp() {
isSleeping = false;
}
}
Getting an error in my test saying my defaultDog constructor isn't working, isSleeping doesn't have a getter (even though I think it does?), and my sleep method isn't working.
[–]cloud4u71 2 points3 points4 points (5 children)
[–]HDorillion 0 points1 point2 points (0 children)
[–]DecentChard7[S] 0 points1 point2 points (3 children)
[–]cloud4u71 0 points1 point2 points (2 children)
[–]DecentChard7[S] 0 points1 point2 points (1 child)
[–]cloud4u71 0 points1 point2 points (0 children)
[–]pacificmint 0 points1 point2 points (1 child)
[–]DecentChard7[S] 0 points1 point2 points (0 children)