J2SE Platform: Development Kits & General Programming

Tech Tips Programming Quiz

By Monica Pawlan
April 1998
Back to Quiz

  1. Why are Java ARchive (JAR) files important?

    Answer (B): They bundle .class files and optimize applet loading.

  2. Which code segment ensures garbage collection happens in a timely manner?

    Answer (A): Nullifying an object reference facilitates garbage collection.
              public Object pop()
              {
                Object p = stk[stkp];
                stk[stkp--] = null;>
                return p;
              }
    


  3. What is the purpose of the toolkit in the Abstract Window Toolkit (AWT)?

    Answer (C): An interface between the abstract window layer and windowing implementation.

  4. What is an interface class?

    A collection of method declarations and constant values.

  5. Vertical and horizontal scroll bar increments are how many units by default?

    Answer (D): 1 unit.

  6. Reflection (introspection) is querying a class about its properties, and operating on methods and fields by the name for a given object instance. Why is reflection possible in the Java language?

    Answer (A): Late binding.

  7. The StringBuffer class supports what type of strings?

    Answer (A): Mutable (changeable).

  8. Why does an Assert class that checks program assertions need several implementations of its assert method?

    Answer (B):The Java language has tight type checking. You need an assert implementation for booleans, byte, char, short, int, long, float, double, and all reference types.

  9. What is serialization?

    Answer (D): A way to convert objects into a stream of bytes.

  10. What is javap?

    Answer (C): A tool for generating information on .class files

You missed 0
Your score is 100 percent.

© 1994-2005 Sun Microsystems, Inc.