Advanced Java - Interview Questions and Answers


  1. What is casting?

    There are two types of casting, casting between primitive numeric types and casting between object references.

    Casting between numeric types is used to convert larger values, such as double values, to smaller values, such as byte values.

    Casting between object references is used to refer to an object by a compatible class, interface, or array type reference.

  2. What is the return type of a program's main() method?
    A program's main() method has a void return type.
  3. Name four Container classes.
    Window, Frame, Dialog, FileDialog, Panel, Applet, or ScrollPane.
  4. What is the difference between a Choice and a List?

    A Choice is displayed in a compact form that requires you to pull it down to see the list of available choices. Only one item may be selected from a Choice.

    A List may be displayed in such a way that several List items are visible. A List supports the selection of one or more List items.

  5. What class of exceptions are generated by the Java run-time system?
    The Java runtime system generates RuntimeException and Error exceptions.
  6. What class allows you to read objects directly from a stream?
    The ObjectInputStream class supports the reading of objects from input streams.

« Prev   [ Page 22 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 |