toString() . For String objects, the toString() method returns a string representation of the object and is the same as the String .
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