Examveda
Examveda

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");
                }
        }
}

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)

This Question Belongs to Java Program >> Flow Control

Join The Discussion

Comments ( 3 )

  1. Tejesh
    Tejesh :
    6 years ago

    boolean a= true, b= true;
    if (a && b)
    this is the correct way

  2. Deepak Deepak
    Deepak Deepak :
    6 years ago

    any one can Convey the answer?

  3. Tabinda Hayat
    Tabinda Hayat :
    7 years ago

    What will be the output and why?

Related Questions on Flow Control