// This can be any item, Integer is here as placeholder.
// Note: You can not use primitives!
Integer number = 5;
String toString = number.toString();
//Using the datatype int
int num = 4;
String intToString = Integer.toString(num);
//Using the datatype Integer
Integer number = 4;
String IntegerToString = number.toString();
//Using double
Double doubleNumber = 3.14;
String doubleToString = doubleNumber.toString();
//valueOf() method (compatible with boolean, char, char[], int, long, float, double, Object)
char character = 'a';
String charToString = String.valueOf(character);
boolean state = false;
String booleanToString = String.valueOf(state);