Advanced Java - Interview Questions and Answers


  1. When can an object reference be cast to an interface reference?
    An object reference be cast to an interface reference when the object implements the referenced interface.
  2. What is the difference between a Window and a Frame?
    The Frame class extends Window to define a main application window that can have a menu bar.
  3. Which class is extended by all other classes?
    The Object class is extended by all other classes.
  4. Can an object be garbage collected while it is still reachable?
    A reachable object cannot be garbage collected. Only unreachable objects may be garbage collected..
  5. Is the ternary operator written x : y ? z or x ? y : z ?
    It is written x ? y : z.
  6. What is the difference between the Font and FontMetrics classes?
    The FontMetrics class is used to define implementation-specific properties, such as ascent and descent, of a Font object.

« Prev   [ Page 14 of 31  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 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |