0
Can anyone check what mistake i did?i cant understand…
3 Réponses
+ 2
@Restoring faith is correct that the reason there is no output is due to your toString method not properly overriding. However, it is possible to still overload the toString method as well. When done the overloaded toString method must be explicitly called though. If you created another method exactly like the one you already have minus the parameters it will work when passing your time object to the println method. Then if you wanted to use the other toString method you would call it on the time object like: time.toString("12", "15", "30")
+ 4
toString() cannot have any parameters. There's no overloading for printing objects.
I assume that's what the issue is atleast. (no errors, so i don't really know if that's what you're confused about)
0
Tq