-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDog.java
More file actions
36 lines (26 loc) · 725 Bytes
/
Dog.java
File metadata and controls
36 lines (26 loc) · 725 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
package com.dj;
public class Dog extends Mammals{
public Dog(String type, String size, double weight) {
super(type, size, weight);
}
@Override
public void move(String speed) {
if (speed.equals("slow")){
System.out.println( getExplicitType() + " walking");
}else {
System.out.println( getExplicitType() + " running");
}
}
@Override
public void shedHAir() {
System.out.println(getExplicitType() + " shed hair all the time");
}
@Override
public void makeNoise() {
if (type == "Wolf"){
System.out.println("Howling! ");
}else {
System.out.println("Woof! ");
}
}
}