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

看板java作者 (我要買車啦)時間18年前 (2007/04/13 00:07), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串8/10 (看更多)
※ 引述《H45 (!H45)》之銘言: : ※ 引述《walm20 (我要買車啦)》之銘言: : : 在問一個問題 : : 課本寫說 : : 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 : 哪一道? 請問 class_type ref; 這個不是建立參考嗎? 還是宣告參考? 課本上(大概寫一下) Interface A { ... } class B implement A { ... } main裡面 B b=new B(); A a=b; // 這行的意思? 這樣不算建立interface的參考嗎? -- -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 218.169.119.35
文章代碼(AID): #167bbTb8 (java)
討論串 (同標題文章)
本文引述了以下文章的的內容:
以下文章回應了本文
完整討論串 (本文為第 8 之 10 篇):
文章代碼(AID): #167bbTb8 (java)