Computer Applications
Which operator cannot be used with if-else statement?
- <=
- ||
- &&
- ? :
Java Conditional Stmts
14 Likes
Answer
? :
Reason — Relational operators ( <= ) and logical operators (|| and &&) can be used to test a condition as they return boolean values. Ternary operator (? :) is used to assign a value to a variable based on a condition. Thus, it cannot be used with if-else statement.
Answered By
10 Likes
Related Questions
Parameters in method definition are called
- actual parameters
- formal parameters
- informal parameters
- void parameters
Give the output of
Math.ceil(-0.6)- -1.6
- -1.5
- -1.0
- -0.0
By default, floating literal is
- double
- float
- int
- long
JVM converts bytecode directly into
- machine code
- another byte code
- high level code
- None of these