Thursday, 19 June 2014

TECHNICAL INTERVIEW AND PRACTICE QUESTIONS ON JAVA - SET 3






TECHNICAL INTERVIEW AND PRACTICE QUESTIONS ON JAVA - SET 3




1.The given statements

   double whatIsThis = -1.0/0.0;
    system .out .println(whatIsThis);


(A) -Math .floor(-x)
(B)  -Math .cell(-x)
(c)  prints -Infinity
(D)  prints a garbage value




2.Math .cell(X) has the same value as


(A)  -Math .floor(-x)
(B) -Math .cell(-x)
(C) -Math .floor(-x)
(D) -Math .cell(x)




3. Let m be a variable of datatype byte .The value of m<<4 is same as


(A)  m x 2^4        (B)  4m             (C)   m^4              (D)   4+ m







4. Which of the following operators take(s) only integer operands ?

(A)  %
(B) ++ (post increment)
(C) ++(pre increment)
(D) None of these.





5. How many #'s do the following statements print ?

for (int m =0, n=10; n-m > 5; ++m , --n)
     system .out .print('#');

(A) 0
(B) 1
(C) 2
(D) 3


No comments:

Post a Comment