Java String.toString()
Syntax
String.toString() has the following syntax.
public String toString()
Example
In the following code shows how to use String.toString() method.
/* w w w. ja va2s . co m*/
public class Main {
public static void main(String[] args) {
String s = "java2s.com";
System.out.println(s.toString());
}
}
The code above generates the following result.