我有一个Player
类和一个Place
类
public class Player{
String name;
int hp;
Place place;
public Player(int health){
this.hp = health;
}
public void setPlace(Place p){
this.place = p;
}
}
我只能以这种方式查看有关组成的示例:在构造函数中:
this.place = new Place();
但是上面的代码呢?是聚集还是组成?