We created one boolean variable first. In second line we used valueOf() to get string out and printed the value.
In last line we checked the type of variable by using getClass().
First we declared one integer variable my_int=45. Printed the value by adding 21, since my_int is an integer, we can add 21 to this.
We created one string variable str1 and stored the string of my_int by using valueOff(). Now we have used string addition ( not integer ) and printed 4521. We also checked the variable type by using getClass().
Using char
char my_char='Z';
String str=String.valueOf(my_char);
System.out.println(str); // Z
System.out.println(str.getClass().getName());// java.lang.String