Java Boolean parseBoolean() MethodLast Updated : 17 Mar 2025 The parseBoolean() method of Boolean class returns the string argument as a Boolean. The value is returned true if the argument is equal to the string "true" otherwise, for null or any other string argument, it returns false. Syntax:Parameters:A String parameter s is passed. Return Value:The logicalXor() method returns the Boolean represented by the string argument.
Example 1Compile and RunOutput: String value = false String hash code value = 97196323 Boolean value = false Boolean hash code value = 1237 Example 2Output: True/False: Q. Tal Mahal is located in Delhi. Ans true 1231 Incorrect. Because Taj Mahal is located in Agra. Example 3Output: Enter any String value : reema Boolean value is false. For any String other than true, parseBoolean() method will return false. Next TopicJava Boolean |
We request you to subscribe our newsletter for upcoming updates.

We deliver comprehensive tutorials, interview question-answers, MCQs, study materials on leading programming languages and web technologies like Data Science, MEAN/MERN full stack development, Python, Java, C++, C, HTML, React, Angular, PHP and much more to support your learning and career growth.
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India