Question
class Output {
public static void main(String args[]) {
String x = Boolean.toString(false);
}
}
What is the output of this program?
class Output {
public static void main(String args[]) {
String x = Boolean.toString(false);
}
}
Answer: Option B
Was this answer helpful ?
toString() Returns a String object representing the specified boolean. If the specified
boolean is true, then the string "true" will be returned, otherwise the string "false" will
be returned
Output:
$ javac Output.java
$ java Output
false
Was this answer helpful ?
Submit Solution