Sunday, July 6, 2008

SCJP: Language Fundamentals

  1. An interface type can be converted to any other interface type.
    Ans: False
  2. A ‘char’ type can be assigned to a double variable(without casting).
    Ans: True
  3. A boolean may be converted to integer and vice-versa by casting.
    Ans: False
  4. In an expression, which has 2 operands, one of which is a long and the other is a float the result will be of ____ type.
    Ans: float
  5. Implicitly converting an interface type to a class type is never allowed.
    Ans: False
  6. byte b=(byte)256;
    System.out.println(b);
    Value of b printed is ___.
    Ans: 0
  7. For unary operators, if the operands is a byte, char or a short, it is converted to __.
    Ans: int
  8. An array can be converted to an object of the class Object without casting.
    Ans: True
  9. An array of integers can be converted to an array of bytes by casting.
    Ans: False
  10. A subclass object can be assigned to a super class type without casting.
    Ans: True

No comments: