CERTIFICATION WATCH

Get the latest certification news by email!

*





*




Our Other Sites

GoExam: Certification practice tests with free demos to download.

GoTraining: Get Training on what you need.

CertificationBooks: Find the certification book you're looking for.

Free Tech Pubs: Free computer industry magazines, newsletters, and whitepapers.

SearchCertify: links, links and more certification links!


HOT SPOTS

Sun Certified Programmer for the Java 2 Platform Quiz #2 (SCJP 1.4)

Question 19:

What will happen when you attempt to compile and run the following code snippet?

Boolean b = new Boolean("TRUE");
    
    if(b.booleanValue())
    {
        System.out.println("Yes : " + b);
    }
    else
    {
        System.out.println("No : " + b);
    }
A. The code will not compile.
B. It will print - Yes : true
C. It will print - Yes : TRUE
D. It will print - No : false
E. It will print - No : FALSE

\n\nnew Boolean("TRUE") produces a Boolean object that represents true.
\n\nnew Boolean("anything") produces a Boolean object that represents false. \n\nThe internal toString() representation of this object produces the boolean value string in lower case, hence it prints "Yes : true" instead of "Yes : TRUE".' )">
 
Follow GoCertify on Twitter