Vidyalelo
Java Programming · all questions

Operators
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

102

Questions

2/6

Page

Pick an option on a question to see the right answer and solution.

What is the value of the expression false || true in Java?

Select an option to see the answer and solution.

What is the value of the expression 8 < 6 ? 4 : 2 in Java?

Select an option to see the answer and solution.

Which operator is used for bitwise NOT in Java?

Select an option to see the answer and solution.

What is the result of the expression 5 ^ 3 in Java?

Select an option to see the answer and solution.

What is the value of the expression true && true in Java?

Select an option to see the answer and solution.

What is the result of the expression 7 / 0 in Java?

Select an option to see the answer and solution.

Which operator is used to perform logical AND in Java?

Select an option to see the answer and solution.

What is the result of the expression 1 << 3 in Java?

Select an option to see the answer and solution.

What is the value of the expression false && false in Java?

Select an option to see the answer and solution.

What is the result of the expression (6 + 3) * 2 in Java?

Select an option to see the answer and solution.

int x = 0, y = 0 , z = 0 ;
x = (++x + y-- ) * z++;

What will be the value of "x" after execution ?

Select an option to see the answer and solution.

int ++a = 100 ; 
System.out.println( ++a ) ;

What will be the output of the above fraction of code ?

Select an option to see the answer and solution.

What is the output of the following program?
class Numbers{
        public static void main(String args[]){
                int a=20, b=10;
                if((a < b) && (b++ < 25)){
                        System.out.println("This is any language logic");
                }
                System.out.println(b); 
        }
}

Select an option to see the answer and solution.

Select from among the following character escape code which is not available in Java.

Select an option to see the answer and solution.

What will be the output?
if(1 + 1 + 1 + 1 + 1 == 5){
        System.out.print("TRUE");
}
else{
        System.out.print("FLASE");
}

Select an option to see the answer and solution.

Which of the following is the correct expression that evaluates to true if the number x is between 1 and 100 or the number is negative?

Select an option to see the answer and solution.

What will be the output?
public class Test{

      public static void main(String args[]){

            System.out.print(""=="");

            System.out.print(" ");

            System.out.print("A"=="A");

            System.out.print(" ");

            System.out.print("a==A");

      }

}

Select an option to see the answer and solution.

What will be the output?
public class Test{
      public static void main(String args[]){
            int a = 42;
            double b = 42.25;
            System.out.print((a%10)+" "+(b%10));
      }
}

Select an option to see the answer and solution.

What will be the output after compiling and running following code?
public class Test{
      public static void main(String... args){
            int x =5;
            x *= 3 + 7;
            System.out.println(x);
      }
}

Select an option to see the answer and solution.

Determine output:
public class Test{
      public static void main(String... args){
            int a=5 , b=6, c=7;
            System.out.println("Value is "+ b + c);
            System.out.println(a + b + c);
            System.out.println("String " + (b+c));
      }
}

Select an option to see the answer and solution.