I was wondering what people put into their toString() methods in Java.
I have been adding a few to some new classes and was wondering if it should include the classname or not.
In the class ClassConfig I cant decide if I should have
@Override
public String toString() {
return "ClassConfig:" + name; //frozen
}
or
@Override
public String toString() {
return name; //frozen
}
Neil
This is really case to case problem. If your intention is to debug, then I guess including class name is much better.