diff --git a/src/main/java/com/github/hcsp/inheritance/User.java b/src/main/java/com/github/hcsp/inheritance/User.java index 1d2c8df..72e0f1a 100644 --- a/src/main/java/com/github/hcsp/inheritance/User.java +++ b/src/main/java/com/github/hcsp/inheritance/User.java @@ -17,6 +17,14 @@ public String getName() { return name; } + @Override + public String toString() { + return "User{" + + "id=" + id + + ", name='" + name + '\'' + + '}'; + } + public static void main(String[] args) { System.out.println(new User(1, "user1")); }