java tostring format code example
Example 1: formartted string java
String str = String.format( "Hello \n World \n my name is %s and i'm %d years old" , "Paul", 27);
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));
}
}