forked from LevinMK23/Java1_03_2020
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnimals.java
More file actions
35 lines (33 loc) · 774 Bytes
/
Animals.java
File metadata and controls
35 lines (33 loc) · 774 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
public class Animals {
protected String name;
protected int runLimit = 0;
protected float jumpLimit = 0f;
protected int swimLimit = 0;
public Animals(String name) {
this.name = name;
}
public void info() {
System.out.println("name: " + name );
}
public void run(int i){
boolean a= false;
if(i<runLimit){
a=true;
}
System.out.println(a);
}
public void jump(float i){
boolean a= false;
if(i<jumpLimit){
a=true;
}
System.out.println(a);
}
public void swim(int i){
boolean a= false;
if(i<swimLimit){
a=true;
}
System.out.println(a);
}
}