Converting Boolean to String

Ads
 

Converting Boolean to String

In this tutorial we are going to convert Boolean to String.

In this tutorial we are going to convert Boolean to String.

Converting Boolean to String

In this section we will discuss about how to convert boolean to String type. This example show you how to convert boolean type to string type. String class provide valueOf() method which is inside java.lang.String package which convert the value into String type.

public class BooleanToString 
  {
	public static void main(String args[])
	{
		Boolean b=false;
		String str=String.valueOf(b);
		System.out.println(str);
		
		}

    }

In the program, valueOf() method of String class is taking boolean type of data and converting into String type which prints the string value.

Ads

Ads