[Solved] How many overrides can be in the to string method of custom classes? [closed]


No. Overloads have to differ in signature, and in this case there’s nothing to vary because the function doesn’t have any arguments.

If you had more than one identical toString function, how would the compiler know which one you intended to call?

1

solved How many overrides can be in the to string method of custom classes? [closed]