自己不知道怎么写出来成空指针了,求大神帮忙写下代码

2024-11-22 12:23:28
推荐回答(1个)
回答1:

指针?java?

public class Ex{
public static void main(String args[]){
Asist asist= new Asist();
Leader leader =new Leader(asist);
}
}

class Asist{
public String name;

}
class Leader{
private String name;
private int age;
private Asist asist;
public Leader(Asist asist){
this.asist=asist;

}
}

简写了很多。。。