[java] How to override toString() properly in Java?