2005-05-09から1日間の記事一覧
JLS2 6.6.2.2 より。でも、super() や無名クラス生成を通じてはアクセスできる。 package foo; public class ProtectedConstructor { protected ProtectedConstructor() { } }package bar; import foo.ProtectedConstructor; class ProtectedConstructorChil…
JLS2 6.3 より。でもなぜ? class SameNameType { // コンパイルエラー class SameNameType { } void test() { // コンパイルエラー class SameNameType { } } }
JLS2 6.4.2 より。 class SameNameMembers { int hello; void hello() { } class hello { } }研修の合間を縫ってJava言語規格(JLS)を読んでみる。JavaVM規格は何回も読んだけどJLSを真面目に読むのは初めて。
売ってないよ!