|
本帖最后由 同学你好 于 20-4-2018 22:26 编辑
根据
public class girlFriend{
private String loveMsg= "";
public girlFriend(String loveMsg){
this.loveMsg=loveMsg;
}
}
public class cuteGirl extends girlFriend {
private boolean sayYes=null;
public cuteGirl(String loveMsg){
super (loveMsg);
this.sayYes=true;
}
}
以下 两种用法在main class里 哪个javac 编译时不会报错
girlFriend myLove = new cuteGirl ("i love u");
cuteGirl myLove = new girlFriend ("i love u"); |
|