Type the default toString output pattern as a comment
Type the default toString output pattern as a comment
Answer
// Default: ClassName@hexHashCode System.out.println(new Dog("Rex", 3)); // Dog@6d06d69c
Without overriding toString(), println delegates to Object.toString() which produces type@hashcode. Override it to get human-readable output.