Java入門・初心者質問スレ Part.8at TECH
Java入門・初心者質問スレ Part.8 - 暇つぶし2ch15:デフォルトの名無しさん
18/06/12 06:11:33.73 AQnxwR2X0.net
>>12
URLリンク(docs.oracle.com)
If a constructor body does not begin with an explicit constructor invocation and
the constructor being declared is not part of the primordial class Object,
then the constructor body implicitly begins with a superclass constructor
invocation "super();", an invocation of the constructor of its direct superclass
that takes no arguments.
コンストラクタの呼び出しが明示されてなければ
super()が暗黙的に呼ばれますよと
public SubClass(String val) {
  // ここでsuper()が呼ばれる
  System.out.println(val);
}
Javaの資格試験の勉強してるなら紫本とか黒本とか
読んだ方がいんじゃないかな
毎回言語仕様調べるの大変でしょ
コンストラクタについても丁寧に解説されてるよ


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch