constructor-arg和property的區別
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
public class Student
{
private Integer
id;
private String
name;
private List<String>
dream;
private Map<String,
Integer> score;
private boolean graduation;
public Student()
{
}
public Student(Integer
id, String name, List<String> dream,
Map<String,
Integer> score, boolean graduation)
{
this .id
= id;
this .name
= name;
this .dream
= dream;
this .score
= score;
this .graduation
= graduation;
}
@Override
public String
toString() {
return "Student
[id=" +
id + ",
name=" +
name + ",
dream=" +
dream
+ ",
score=" +
score + ",
graduation=" +
graduation + "]" ;
}
}
|