Core Java - Interview Questions and Answers


  1. What are the legal operands of the instanceof operator?
    The left operand is an object reference or null value and the right operand is a class, interface, or array type.
  2. Are true and false keywords?
    The values true and false are not keywords.
  3. What happens when you add a double value to a String?
    The result is a String object.
  4. What is the diffrence between inner class and nested class?
    When a class is defined within a scope od another class, then it becomes inner class. If the access modifier of the inner class is static, then it becomes nested class.
  5. Can an abstract class be final?
    An abstract class may not be declared as final.
  6. What is numeric promotion?
    Numeric promotion is the conversion of a smaller numeric type to a larger numeric type, so that integer and floating-point operations may take place. In numerical promotion, byte, char, and short values are converted to int values. The int values are also converted to long values, if necessary. The long and float values are converted to double values, as required.

« Prev   [ Page 17 of 22  Jump... Next »

Jump to page : 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |