Back
How to convert String object to Boolean object?
1. Convert using constructor
Boolean blnObj1 = new Boolean(str);
System.out.println(blnObj1);
2. Use valueOf method
This is a static method of Boolean class.
Boolean blnObj2 = Boolean.valueOf(str);
System.out.println(blnObj2);
31k questions
32.8k answers
501 comments
693 users