Operator in Java MCQs Exercise I

Ques 1 Operator


What is the output of the following code ?

class Test
{
      public static void main(String[] args){
           int a=10;
           int b=a;
           a++;
           int c=b;
           c++;
           System.out.println(b);
      }
}

A 10
B 11
C 12
D 13

Ques 2 Operator


What is the result of the following expression: 5 / 2.0?

A 2.5
B 2
C 2.0
D 2.2

Ques 3 Operator


Which operator is used to perform logical negation in Java?

A !
B ~
C -
D ++