The line of code is System.out.println( new SubClass() ); so first a new SubClass object will be created and that object will be passed to the println method. The method will then cause the toString method on that object to be invoked.
The line of code is System.out.println( new SubClass() ); so first a new SubClass object will be created and that object will be passed to the println method. The method will then cause the toString method on that object to be invoked.