Java String valueOf() method

Java String valueOf() method converts different types of values into String.

Such as : int to String, long to String, boolean to String, character to String, float to String, double to String, object to String and char array to String.

Syntax:

Returns:

 It returns String, representation of given value.

Java String valueOf(char c) method example 

Output:

Java String valueOf() method example 2

Output:

Java String valueOf(boolean bol) method example 3

Output:

Java String valueOf(float f) and valueOf(double d) Example 4

Output:

Java String valueOf Example 5

Output:

Leave a Comment