We can write a toString() method instead of writing more code especially include with lot of variable, it can be possible like below by using Apache Commons library.
public String toString() {
return ToStringBuilder.reflectionToString(this);
}
public String toString() {
return ToStringBuilder.reflectionToString(this);
}
No comments:
Post a Comment