Convert Boolean object to String object - Java Language Basics

Java examples for Language Basics:boolean

Description

Convert Boolean object to String object

Demo Code

 
public class Main {
 
  public static void main(String[] args) {
    //construct Boolean object
    Boolean blnObj = new Boolean("true");
   /*www . ja  v  a 2  s . co  m*/
    //use toString method of Boolean class to convert it into String
    String str = blnObj.toString();
    System.out.println(str);
  }
}

Result


Related Tutorials