Home Tutorials Java StringExamples java.lang.String.valueOf(boolean bool)
Questions:Ask|Latest



java.lang.String.valueOf(boolean bool)
Posted on: March 22, 2005 By Deepak Kumar
The given example shows how to convert the boolen value into string.

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


Recommend the tutorial

Ask Questions?    Discuss: java.lang.String.valueOf(boolean bool)  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments