?
2016-10-08 15:23:54 UTC
a) = is a comparison operator. == is an assignment operator.
b) = and == can be used interchangeably.
c) = is an assignment operator. == is a comparison operator.
d) = is only used with numeric values. == is only used with boolean values. ***
7. What are the two boolean literal values in Java?
a) true and false ***
b) 0 and 1
c) True and False
d) t and f
8) and is true about if-else statements?
a) The if-else sttatement provides two blocks of code that will both be executed if its boolean expression is true.
b) the if-else statement truest its expression again if its boolean expression is false.
c) the if-else statement is similar to the if statement in that it only executes code if its boolean expression is true.
d) The if-else statement provides a way to execute code in case its boolean expression is false. ***
9. If x is an int variable, which of the following contains invalid Java code?
if (x<5) x++;
if (x<5) { x++; }
if x<5 x++; ***
if (x<5) if (x>0) x++;