to string method in java code example
Example 1: stringbuilder to string java
StringBuilder.toString();
//the text will be whatever information you gave in the constructor
Example 2: tostring method in java
public class Test {
public static void main(String args[]) {
Integer x = 5;
System.out.println(x.toString());
System.out.println(Integer.toString(12));
}
}