java.lang.String.valueOf(boolean bool)

The given example shows how to convert the boolen value into string.

java.lang.String.valueOf(boolean bool)

The given example shows how to convert the boolen value into string. Basically the "bool" parameter of the valueof method converts the boolean value into the string.

a simple example of valueof(boolean bool) method in Java.

public static void main(String[] args)
{
String Strtrue = String.valueOf(true);
String Strfalse = String.valueOf(false);

//will display the boolean values.
System.out.println(Strtrue);
System.out.println(Strfalse);
}
}

The output is:
true
false