0

次のコード セグメントがtoString()メソッドを自動的に呼び出すのはなぜですか?

コード:

public class Demo {
   public Demo() {
    System.out.println(this); // Why does this line automatically calls toString()?
    }

   public static void main(String[] args) {
    Demo dm = new Demo();
   }
}
4

4 に答える 4