Limited access

Upgrade to access all content for this subject

Consider the following code.

// Assume flag is defined as a boolean variable
System.out.println( !flag && flag || !flag );

What will this statement print to the console?

A

It will always print the value assigned to flag.

B

It will always print the opposite of the value assigned to flag.

C

It will always print true.

D

It will always print false.

E

It will throw an error.

Select an assignment template