What will be the output?
public class Test{
public static void main(String[] args){
int x=10, y=0;
if(x && y){
System.out.print("TRUE");
}
else{
System.out.print("FALSE");
}
}
}
public class Test{
public static void main(String[] args){
int x=10, y=0;
if(x && y){
System.out.print("TRUE");
}
else{
System.out.print("FALSE");
}
}
}
A. FALSE
B. TRUE
C. Compilation Error
D. Runtime Error
Answer: Option C
Solution(By Examveda Team)
bad operand types for binary operator '&&'if(x && y)
Join The Discussion
Comments ( 3 )
Related Questions on Flow Control
What is the purpose of the "if" statement in Java?
A. To execute a block of code conditionally
B. To create loops
C. To declare variables
D. To define methods
A. No output
B. Error
C. Hello
D. 5
boolean a= true, b= true;
if (a && b)
this is the correct way
any one can Convey the answer?
What will be the output and why?