Consider the following:
What is the result?
Boolean.parseBoolean("true") produces true. The Boolean(String) constructor creates a Boolean representing false when the supplied string is null, so no NullPointerException occurs. Boolean string representations are lowercase; the output is true false. Choice A is the intended matching option despite its capitalization. Oracle Boolean API
Boolean.parseBoolean("true")
true
Boolean(String)
Boolean
false
null
NullPointerException
true false
Community Discussion