Skip to content

Commit b248044

Browse files
committed
inheritance and super class
1 parent 4fc3867 commit b248044

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

src/fish.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
public class fish extends Animal {
2+
private int gills;
3+
private int eyes;
4+
private int fins;
5+
6+
public fish(String name, int size, int weight, int gills, int eyes, int fins) {
7+
super(name, 1, 1, size, weight);
8+
this.gills = gills;
9+
this.eyes = eyes;
10+
this.fins = fins;
11+
}
12+
private void rest(){
13+
14+
}
15+
private void moveMuscles(){
16+
17+
}
18+
private void backFin(){
19+
20+
}
21+
private void swim(int speed){
22+
moveMuscles();
23+
backFin();
24+
super.move(speed);
25+
26+
}
27+
}

0 commit comments

Comments
 (0)