Java – How to get the String representation of the Boolean value in Java ?

Published on March 9, 2016 by admin

Filed under Java

Last modified March 9, 2016

Print this page

rate 1 star rate 2 star rate 3 star rate 4 star rate 5 star
Your rating: none, Average: 3.4 (13 votes)

This article have been viewed 17837 times

Problem statement

You need to convert the Boolean value to string and display the string representation of the same.


Use the toString static method defined in the Boolean class for the conversion.

public class Main {

    public static void main(String[] args) {

        System.out.println(" Java Tutorials");

        Boolean b1 = new Boolean("false");
        String str = Boolean.toString(b1);


The output of the above program is Java Tutorials


Leave a Comment


You might be Interested in these Posts

Video - Angular Router - Brian Ford

Video - Angular Router - Brian Ford ...

Video - An Angular2 Todo App: First look at App Development in Angular2

In this screencast , David East , one of the core contributor of the Angular provides a glimpse of A...

Video - Getting started with Angular 2

In this screencast , Alex Eagle , developer on the Angular team talks about Angular 2 developer prev...