Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following Java program?
class Output
{
public static void main(String args[])
{
String x = Boolean.toString(false);
}
}

What will be the output of the following Java program?
class Output
{
public static void main(String args[])
{
String x = Boolean.toString(false);
}
}
a) true
b) false
c) System Dependent
d) Compilation Error

Answer: b
Explanation: 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:
false

Join The Discussion