我練習和簡單的運動,給定定義爲具有下列方法FeatureFilm類:由編譯器(簡單的Java運動)允許的方法頭
public void update(Actor a, String title)
public void update(Actor a, Actor b, String title)
public void update(String topic, String title)
下列哪些額外的方法頭會編譯器允許嗎?
public boolean update(String category, String theater)
public boolean update(String title, Actor a)
public void update(Actor b, Actor a, String title)
public void update(Actor a, Actor b)
所以,我做的代碼和編譯器不允許這種方法:public boolean update(String category, String theater)
和public void update(Actor b, Actor a, String title)
,但我不完全理解爲什麼。有人可以向我解釋這個嗎? 我希望能夠充分利用這個網站。我是OPP初學者。 對不起,我的(可憐的)英語, 謝謝。
[你在這裏](https://docs.oracle.com/javase/tutorial/java/javaOO/methods。html) – Maroun
編譯器如何在'public void update(String topic,String title)'和'public boolean update(String category,String theater)'之間進行選擇? 或者'public void update(Actor a,Actor b,String title)'和'public void update(Actor b,Actor a,String title)'之間? –