Usually just for the convenience of output, such as System.out.println(xx). If the "XX" in parentheses is not a string type, the toString () method of xx will be called automatically.
In a word, it is just a method specially added by sun Company to facilitate the string operation of all classes when developing java.