无关紧要
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package chapter4.object;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
class Student {
|
||||
private String name;
|
||||
private int age;
|
||||
@@ -9,11 +11,17 @@ class Student {
|
||||
this.age = age;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "Student {name=" + name + ", age=" + age + "}";
|
||||
}
|
||||
// public String toString() {
|
||||
// return "Student {name=" + name + ", age=" + age + "}";
|
||||
// }
|
||||
}
|
||||
|
||||
public class Test {
|
||||
public static void main(String[] args) {
|
||||
Student s1 = new Student("张三", 23);
|
||||
|
||||
System.out.println(s1);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user