Re: [問題] Inner class 中的 static function
※ 引述《fantasywater (肝苦人)》之銘言:
: 請問一下 Static Inner class 中的 Static Method 有什麼特別的涵義嗎?
: 他和一般的 static method 有什麼不同呢? 還是其實和一般的 static method 是一樣的?
: 我不太懂為什麼 Static Inner Class 中或有 Static Method,
: 有人可以說明一下嗎? 感謝 :)
http://download.oracle.com/javase/tutorial/java/javaOO/nested.html
"嚴格來說" static inner class 並不存在,
只有 non-static nested class 可以被稱為 inner class。
下面節錄我以前的筆記:
Static Nested Class 又稱為 top-level class,
或著 static inner class,但是事實上它並不是 inner class,
因為 outer class 和 static nested class 的 instance
之間並不存在任何關係。
可以想成 static nested class 只是多了一層 name-space。
--
◤ ◥ ◢ ◣
T$,修好它吧。 ⊙▁⊙─ ─⊙▂⊙ 碰到問題,用SoftICE就對了!
╰ ∕皿﹨ ◥皿◤ ╯
◥█◤◢ ◥ ︶◤
Lee ◤ ︶ ◥◤ ﹨▼∕◥ T$ Chen
MYTHBUGTERS ◥ ◤\◥ by dajidali
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.114.78.231
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):