542). Which of these methods is used to know whether a string contains “true”?

[A]valueOf()
[B]valueOfString()
[C]getString()
[D]none of the mentioned

Show Answer

543). Which of these class have only one field?

[A]Character
[B] Boolean
[C]Byte
[D]void

Show Answer

544). What will be the output of the following Java program?
    class Output
    {
        public static void main(String args[])
        {
            String str = "true";
            boolean x = Boolean.valueOf(str);
            System.out.print(x);
        }
    }

[A]True
[B]False
[C]Compilation Error
[D] Runtime Error

Show Answer

545). What will be the output of the following Java program?
    class Output
    {
        public static void main(String args[])
        {
            String str = "true false true";
            boolean x = Boolean.valueOf(str);
            System.out.print(x);
        }
    }

[A]True
[B]False
[C]Compilation Error
[D]Runtime Error

Show Answer

546). What will be the output of the following Java program?
    class Output
    {
        public static void main(String args[])
        {
            String str = "TRUE";
            boolean x = Boolean.valueOf(str);
            System.out.print(x);
        }
    }

[A]True
[B]False
[C] Compilation Error
[D]Runtime Error

Show Answer

547). What will be the output of the following Java program?
    class Output 
    {
        public static void main(String args[])
        {
	    String str = "true false";
            boolean x = Boolean.parseBoolean(str);
            System.out.print(x);
        }
    }

[A]True
[B]False
[C]System Dependent
[D]Compilation Error

Show Answer

548). 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

Show Answer