The toString method is used to return a string representation of an object . If any object is printed, the toString() method is internally invoked by the java compiler. Else, the user implemented or overridden toString() method is called.
Read moreWhat is to string method in Java?
A toString() is an in-built method in Java that returns the value given to it in string format . Hence, any object that this method is applied on, will then be returned as a string object.
Read moreWhat is the return to string () method?
The toString() method returns the String representation of the object . If you print any object, Java compiler internally invokes the toString() method on the object.
Read more