Test Series - java

Test Number 26/64

Q: What is the other name for a Question Mark - Colon (?:) operator in Java?
A. Special Relational operator
B. Special Logical Operator
C. Ternary Operator
D. None
Solution: no solution
Q: Java Ternary operator is sometimes called ____.
A. Relational Operator
B. Conditional Operator
C. Logical Operator
D. None
Solution: no solution
Q: The condition of a Java Ternary operator should evaluate to ___.
A. 1 or 0
B. true or false
C. TRUE or FALSE
D. None
Solution: no solution
Q: State TRUE or FALSE. True expression part comes first after ? (question mark) symbol and before : (colon) symbol.
A. FALSE
B. TRUE
C. TRUE or FALSE
D. None
Solution: no solution
Q: Java Ternary operator can be used with ___.
A. if-else statements
B. while, do while loops
C.  for loop, enhanced for loop
D. All
Solution: no solution
Q: A java Ternary operator has priority less than ___.
A. Relational operators
B. Arithmetic operators
C. Logical and bitwise operators
D. All
Solution: no solution
Q: Java assignment operator has priority more than ___.
A. Assignment and Lambda operator
B. Logical and bitwise operator
C. Arithmetic operators
D. Logical operators
Solution: no solution
Q: The True Part Expression of a Java conditional operator or Ternary operator ____ return a value.
A. may
B. can
C. must
D.  None
Solution: The True/False part expression should evaluate to a constant literal.
Q: The False Part Expression of a Java conditional operator or Ternary operator ____ return a value.
A. may
B. can
C. must
D. None
Solution: no solution
Q: Choose a possible error with a Ternary operator while compiling a Java program.
A. The left-hand side of an assignment must be a variable.
B. void is an invalid type for the variable
C. Type mismatch: cannot convert from void to int
D. All
Solution: no solution

You Have Score    /10