java.lang.String.valueOf(boolean bool)

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

Ads

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

Advertisements

Share on Google+Share on Google+

java.lang.String.valueOf(boolean bool)

Posted on: March 22, 2005 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

 

Discuss: java.lang.String.valueOf(boolean bool)  

Post your Comment


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

Ads

 

Ads