Look at this code snippet:
class Person {
private String name;
private int age;
public Person(String name, int age) {
System.out.println(this);
this.name = name;
this.age = age;
}
@Override
public String toString() {
return "name=" + name + ", age=" + age;
}
}
What will be printed to the console if we create the following Person object:
Person person = new Person("Test Dummy", -4);