What is the output of the following code?

boolean even = false;
System.out.println((even ? "true" : "false"));

a. true
b. false
c. nothing
d. true false


b Since even is false, the conditional expression yields false. The correct answer is B.

Computer Science & Information Technology

You might also like to view...

Which of the following consists of hardware and operating system settings used to create a new virtual machine?

A. hardware profiles B. templates C. operating system profiles D. ISO files

Computer Science & Information Technology

What are the three main parts of a use case scenario?

What will be an ideal response?

Computer Science & Information Technology

On Facebook, tags are permanent and cannot be removed by the person tagged if they prefer to remain private

Indicate whether the statement is true or false

Computer Science & Information Technology

The result of the function in B2 is:

In cell A1, input the data: HELLOWORLD In cell B2, input the function: =LEFT(A1,1)&MID(A1,2,1)&MID(A1,5,1)&MID(A1,4,1)&MID(A1,6,1) A. HELLO B. HEOLW C. HELLOW D. #VALUE E. HEOLLW

Computer Science & Information Technology