為什么我會顯示報錯,The left-hand side of an assignment must be a variable
public?void?testChild()?{ ChildCourse?ccr?=?new?ChildCourse(); ccr.getId()?=?"3"; ccr.name()?=?"我是子類型的課程對象實例"; courses.add(ccr);
第三行和第四行報錯?The left-hand side of an assignment must be a variable
2019-12-08
沒有定義這個:ccr.getId()吧,Course.java里有id,沒有g(shù)etId()。改成ccr.id ="3"? 試試