Convert Boolean to String in Java
Description
The following code shows how to convert Boolean to String.
Example
/* w w w .j a va 2 s . co m*/
public class Main {
public static void main(String[] args) {
boolean theValue = true;
//boolean to String conversion
String theValueAsString = new Boolean(theValue).toString();
System.out.println(theValueAsString);
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »