Home Tutorials Java StringExamples java.lang.String.valueOf(boolean bool)

Related Tutorials


 
 

Share on Google+Share on Google+

java.lang.String.valueOf(boolean bool)

Advertisement
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

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: March 22, 2005

Related Tutorials

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

Post your Comment


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