Re: [問題] interface裡的attribute const?

看板java作者 (!H45)時間18年前 (2007/04/12 11:45), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串5/10 (看更多)
※ 引述《walm20 (我要買車啦)》之銘言: : ※ 引述《DavyBlue (ArssertionError)》之銘言: : : 在interface中 : : 所有method都是抽象方法 : : public abstract : : 無論有無宣告 編譯時都會自動補上 : : 所有類別屬性 都是常數 : : public static final : : 無論有無宣告 編譯時都會自動補上 : : 以上 : 在問一個問題 : 課本寫說 : interface and abstract class不行建立參考 : 可是後面程式範例 : 有建立interface參考到一個繼承這interface的物件(implement這interface的 class) : 先謝謝大家摟 問題點在於,你了解什麼叫作「建立參考」嗎? 是意指建立一個新的實體 istance new Something(); //where Something is not an interface nor an abstract class 還是指某個 member field 的定義 Otherthing otherthing; //where Otherthing is an interface or an abstract class 或者是指多型 Polymorphism Otherthing otherthing = new Something(); // where Something is a class that implements Otherthing, and // Otherthing is an interface 哪一道? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.115.205.85
文章代碼(AID): #167QjP-t (java)
討論串 (同標題文章)
本文引述了以下文章的的內容:
以下文章回應了本文
完整討論串 (本文為第 5 之 10 篇):
文章代碼(AID): #167QjP-t (java)