1. Home
  2. Computing & Technology
  3. Computer Certification

Question 6

What will be the result of executing the following code?

1.    boolean a = true;

2.    boolean b = false;

3.    boolean c = true;

4.    if (a == true)

5.    if (b == true)

6.    if (c == true)                      System.out.println("Some things are true in this world");

7.    else                               System.out.println("Nothing is true in this world!");

8.    else if (a && (b = c))              System.out.println("It's too confusing to tell what is true and what is false");

9.    else                                System.out.println("Hey this won't compile");


The code won't compile
"Some things are true in this world" will be printed
"Hey this won't compile" will be printed
None of these

Back to beginning
| Next Question



Explore Computer Certification
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Computer Certification

©2009 About.com, a part of The New York Times Company.

All rights reserved.