Sail E0 Webinar
Question


What is the output of this program?


class Output {
public static void main(String args[]) {
String str = "true false";
boolean x = Boolean.parseBoolean(str);
System.out.print(x);
}
}
Options:
A .  true
B .  false
C .  System Dependent
D .  Compilation Error
Answer: Option B

parseBoolean() Parses the string argument as a boolean. The boolean returned 


Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers