This is basically what I'm trying to achieve.
classname @address (?) [original toString() ], object name, object age
@Override public String toString() { return String.format("%s , %s , %d", this.toString(), this.getName(),this.getAge()); }
The problem is, toString() is called recursively.
I cannot call super.toString() because this is not what I want. I want this call the original toString() .
it
this.super.toString()
not working for obvious reasons.
Itβs running out for me, can this be done when the method is overridden? That is, to call the initial implementation?
(my edit) Basically I need to: override toString to display the two properties of the 'this' object, and I also want 'this' to call the original toString.
This is not a project or a job. Just a game (training) with the Java language. thanks
Marin source share