Java Program for String representation of Boolean

Boolean is a Primitive datatype in Java with two values, TRUE or FALSE. We can interpret Boolean in String or convert Boolean to String using the toString() method.

Let us now see some examples for displaying String representation of Boolean in Java.

Example 1

Following is an example of string representation of Boolean using toString() method:

Output

Example 2

Let us now see another example for String representation of Boolean using valueOf() method:

Output

Java Program to parse string to a Boolean object
Compare two Boolean Arrays in Java
Studyopedia Editorial Staff
Studyopedia Editorial Staff
[email protected]

We work to create programming tutorials for all.

No Comments

Post A Comment