Page 73 - CA_Blue( J )_Class10
P. 73

6.  Which of the following is an equivalent expression of a = a + 4?
                       a.  a++++                                       b.  a += 4
                       c.  a =+ 4                                      d.  a + 4
                    7.  What will be the result of the following code?
                       int a =10, b = 3, c = 0;
                       c = b % a;
                       a.  10                                          b.  0.3
                       c.  0                                           d.  3
                    8.  What will be the output of the following code?
                       int a = 1, b = 2, c = 3, d;
                       d=a++ / ++b * c;
                       System.out.print(d);
                       a.  0                                           b.  1
                       c.  2                                           d.  3
                    9.  What will be the output of the following code?
                       double a = 1, b = 2, c = 3, d;
                       d=a++ / ++b * c;
                       System.out.print(d);
                       a.  0.0                                         b.  1.0
                       c.  2.0                                         d.  3.0
                   10.  What will be the output of the following code?
                       int a = 10, b = 30 , c = 15;
                       System.out.println((a + b) < c ? (a + b):(a - b));
                       a.  10                                          b.  40
                       c.  -20                                         d.  20
                   11.  Which of these is a valid Java expression for the following Math expression?
                       ut+1/2ft 2
                       a.  ut + 1.0 / 2.0ft*t                          b.  u * t + 1 / 2 * f * t * t
                       c.  (u * t) + (1.0 / 2.0 * f * t * t)           d.  None of these
                   12.  If a = 1 and b = 0, then what will return the following expression?
                       (a > b) && (a < b)
                       a.  true                                        b.  false
                       c.  Both a and b                                d.  None of these

                   13.  Which of the following operator is used to create the object of a class?
                       a.  dot(.)                                      b.  new
                       c.  ==                                          d.  Unary

                   14.  Which of the following operators will return true if both the expressions are true?
                       a.  ||                                          b.  &&
                       c.  ++                                          d.  --
                   15.  Which of the following is not a form of operator in Java?
                       a.  Binary                                      b.  Unary
                       c.  Ternary                                     d.  None of these

                  Answers
                     1.  c      2.  b       3.  a       4.  c       5.  a       6.  b       7.  d        8.  a
                     9.  b      10.  c      11.  c      12.  b      13.  b      14.  b      15.  d




                                                                                                                       71
                                                                                                      Operators in Java   71
   68   69   70   71   72   73   74   75   76   77   78