-
Notifications
You must be signed in to change notification settings - Fork 0
/
Player.java
47 lines (38 loc) · 917 Bytes
/
Player.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
43
44
45
46
47
import java.util.*;
public class Player{
private String name;
private ArrayList<Player> team;
private int height;
private int weight;
public Player(String n, int h, int w){
name=n;
height=h;
weight=w;
}
private final class Playerstats{
private String name;
private int height;
private int weight;
public void Player(String n, int h, int w){
name=n;
height=h;
weight=w;
}
public String toString(){
return name+" is "+height+" inches tall and weighs "+weight+" pounds.";
}
}
public Player addPlayer(String name, int height, int weight){
Player p1=new Player(name, height, weight);
team.add(p1);
return p1;
}
private final class Dumbell{
private int weight;
private boolean adjustable;
public Dumbell(int w, boolean a){
weight=w;
adjustable=a;
}
}
}