Take a few minutes to test your general knowledge of Java programming. These questions are compiled from the JDC Tech Tips. If you do not know an answer, take a guess.
1. Why are Java ARchive (JAR) files important?
2. Which code segment ensures garbage collection happens in a timely manner?
public Object pop() { Object p = stk[stkp]; stk[stkp--] = null; return p; }
public class Stack { private static final int MAXLEN = 10; private Object stk[] = new Object[MAXLEN]; private int stkp = -1; public void push(Object p) {stk[++stkp] = p;} public Object pop() {return stk[stkp--];} }
3. What is the purpose of the toolkit in the Abstract Window Toolkit (AWT)?
4. What is an interface class?
5. Vertical and horizontal scroll bar increments are how many units by default?
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?
7. The StringBuffer class supports what type of strings?
8. Why does an Assert class that checks program assertions need several implementations of its assert method?
9. What is serialization?
10. What is javap?
© 1994-2005 Sun Microsystems, Inc.