Witch of the following expresions are incorrect? Please correct them
a."R" < 6
B. "D" * "5"
C. True < "F"
D. False >= 7
E. 5.9 \ 4
F. Like a equation: 5= totaltime - 40
Variables in any language should not be used with quotes around. In context of Java, here
a. Incorrect as, if R is a variable, and is compared with 6, then it should be written as R and not "R".
B. Incorrect Here both D and 5 should not be used with quotes around. And even if D and 5 are strings, they cannot be used for the operand *. The y can be used with the concatenation operator , +.
C. Incorrect if True is variable, even then it cannot be directly compared with a string using the binary operator.
D. Incorrect for the reason stated above.
E. Incorrect as there is no such operator defined that takes a backslash and it is treated as an illegal character in Java. The correct statement would be: 5.9/4.
F. Incorrect as the left side of the assignment operator should be a variable and not a fixed value.
Get Answers For Free
Most questions answered within 1 hours.