Menu
Topics Index
...
`

My reaction2375


If you need explanation Read this topic

If you need Answer Take test on this topic

My reaction2375
What will be the output of the following program?
public class ResultsTime {
    public static void main(String[] args) {
        Boolean pass = new Boolean(false);
        Boolean fail = new Boolean("tRuE");
        if (pass) {
            System.out.println(":)");
        } else {
            System.out.println(":(");
        }
    }
}

A. :(
B. :)
C. Compilation Error
D. Runtime Error
Topic: Java Boolean Class

If you need explanation Read this topic

If you need Answer Take test on this topic

User comments below. All of them might not be correct.

ans is a since pass will not be evaluated and goes for else condition

Posted by Ramesh Velpukonda    2014-09-11 12:43:25


A is ans. as if condtion dsnt satisfies.

Posted by Shabaaz Shaikz    2014-09-11 12:43:32


compilation error

Posted by Vishnu Raghunath    2014-09-11 15:28:19


Ans A

Posted by Pranavi Prakash    2014-09-11 15:35:38


Congratulations Ramesh Velpukonda. You are this dose winner. We will send you the link using which you can claim your recharge.

Posted by Merit Campus    2014-09-12 04:03:13


© meritcampus 2019

All Rights Reserved.

Open In App