Question
What is the output of this program?
class Output {
public static void main(String args[]) {
String str = "true false true";
boolean x = Boolean.valueOf(str);
System.out.print(x);
}
}
Answer: Option A valueOf() returns true if the specified string contains "true" in lower or uppercase
and false otherwise.
Output:
$ javac Output.java
$ java Output
false
Was this answer helpful ?
Submit Comment/FeedBack