Java Technology Home Page
A-Z Index

Java Developer Connection(SM)
Quizzes

Downloads, APIs, Documentation
Java Developer Connection
Tutorials, Tech Articles, Training
Online Support
Community Discussion
News & Events from Everywhere
Products from Everywhere
How Java Technology is Used Worldwide
Print Button
 
Quizzes Index
Tech Tips Programming Quiz
Compiled by Monica Pawlan

(April 1998)

The Novel by Vincent van Gogh Take a few minutes to test your general knowledge of JavaTM programming. These questions are compiled from the JDC Tech Tips. If you do not know an answer, take a guess.
The Novel by Vincent van Gogh

  1. Why are Java ARchive (JAR) files important?
     A. They are necessry for installation and configuration.
     B. They bundle .class files and optimize applet loading.
     C. They prevent security leaks.
     D. They save coding time.

  2. Which code segment ensures garbage collection happens in a timely manner?
     A.
    public Object pop()
    {
      Object p = stk[stkp];
      stk[stkp--] = null;
      return p;
    }
    
     B.
    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)?
     A. To repair broken frames.
     B. To create custom components.
     C. An interface between the abstract window layer and windowing implementation.
     D. To facilitate multicolor printing.

  4. What is an interface class?
     A. A collection of method declarations and constant values.
      B. An abstract base class.
     C. A way to get multiple inheritance.
     D. A way to inherit variables and method implementations.

  5. Vertical and horizontal scroll bar increments are how many units by default?
     A. 12.5 units.
     B. 100 units.
     C. 5 units.
     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?
     A. Late binding.
     B. Early binding.
     C. Java developers are very introspective people.
     D. Reflection is possible in all languages.

  7. The StringBuffer class supports what type of strings?
     A. Mutable (changeable).
     B. Immutable (unchangeable).
     C. Violins and cellos.
     D. Rotated and scaled.

  8. Why does an Assert class that checks program assertions need several implementations of its assert method?
     A. The Java language has loose type checking.
     B. The Java language has tight type checking.
     C. To keep tabs on garbage collection.
     D. You never know how many you need, so you should always cover the most obvious cases.

  9. What is serialization?
     A. Compiling serveral class files in series.
     B. Selecting several items with a series of rapid mouse clicks.
     C. Assigning a special number to an application.
     D. A way to convert objects into a stream of bytes.

  10. What is javap?
     A. A tool for making classes public.
     B. The Java print command.
     C. A tool for generating information on .class files
     D. The Java profiler.

Print Button
[ This page was updated: 27-Sep-2000 ]
Products & APIs | Developer Connection | Docs & Training | Online Support
Community Discussion | Industry News | Solutions Marketplace | Case Studies
Glossary | Feedback | A-Z Index
For more information on Java technology
and other software from Sun Microsystems, call:
(800) 786-7638
Outside the U.S. and Canada, dial your country's AT&T Direct Access Number first.
Sun Microsystems, Inc.
Copyright © 1995-2000 Sun Microsystems, Inc.
All Rights Reserved. Terms of Use. Privacy Policy.