String toString() is the built-in method of java.lang which return itself a string. So here no actual conversion is performed. Since toString() method simply returns the current string without any changes, there is no need to call the string explicitly, it is usually called implicitly.
public String toString()
Parameter: The method does not accept any parameters .
Return Value: This method returns the string itself.
Input: String("geeksforgeeks") Output: geeksforgeeks
Below programs illustrate the Java.lang.String.toString() method:
Output String Value :Welcome to the world of geeks. Output String Value :Let's make it simple for you.
Output : THank You
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.