Sun Java Solaris Communities My SDN Account Join SDN

Annual Developer Quiz

 

Quizzes Index

December 2008

Duke Test your knowledge of Java technology topics covered recently on java.sun.com.
  1. Does the following line of code correctly declare a JavaFX sequence?
     
       var days = ["Mon","Tue","Wed", ["Thu", ["Fri","Sat","Sun"]]];
    
     
     A. Yes
     B. No
     
  2. Which of the following features are available in the Lightweight User Interface Toolkit (LWUIT)?
     A. UI components such as buttons and tabbed panes
     B. Screen transitions
     C. Layout managers
     D. All of the above
     E. None of the above
     
  3. A Java class includes the following annotation:
     
       @UriTemplate("/users/");
    
     
    What does the annotation represent?
     A. A JAX-RS annotation that specifies the URI path for a resource.
     B. A JAX-WS annotation that specifies the servlet mapping URL pattern for the service endpoint.
     C. A JAXB annotation that specifies a URI template for marshalling XML to Java objects.
     D. A WSIT annotation that specifies a URI pattern for access to a Windows .NET client.
     
  4. Which of the following elements can be added to an <APPLET> tag so that an applet can be dragged from a browser onto a desktop running Java SE 6 Update 10, with the applet continuing to run?
     A. <PARAM value="dragdrop">
     B. <OPTIONS name="drag" value="true">
     C. <PARAM name="draggable" value="true">
     D. This operation is not supported in Java SE 6 Update 10.
     
  5. Is it possible in the NetBeans IDE to run or debug a single test method in a Ruby test case that contains multiple test methods?
     A. Yes
     B. No
     
  6. What is Greenfoot?
     A. A software tool for identifying memory leaks in a program.
     B. An Enterprise JavaBeans container.
     C. A JavaScript widget library.
     D. A learning tool aimed at high school level students.
     E. A package of security tools for mobile application development.
     
  7. Each of the following two program displays a window with three buttons arranged vertically. In which of the programs will the space between the buttons increase if the height of the window increases?
     A.
       import java.awt.*;
       import javax.swing.*;
       public class VerticalBoxTest {
        public static void main(String args[]) {
           JFrame frame = new JFrame("Vertical Box");
           frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
           Box box = Box.createVerticalBox();
           box.add(new Button("Top"));
           box.add(Box.createVerticalStrut(25));
           box.add(new Button("Middle"));
           box.add(Box.createVerticalStrut(10));
           box.add(new Button("Bottom"));
           frame.add(box, BorderLayout.CENTER);
           frame.setSize(300, 200);
           frame.setVisible(true);
         }
       }
    
     B.
       import java.awt.*;
       import javax.swing.*;
       public class VerticalBoxTest {
         public static void main(String args[]) {
           JFrame frame = new JFrame("Vertical Box");
           frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
           Box box = Box.createVerticalBox();
           box.add(new Button("Top"));
           box.add(Box.createVerticalGlue());
           box.add(new Button("Middle"));
           box.add(Box.createVerticalGlue());
           box.add(new Button("Bottom"));
           frame.add(box, BorderLayout.CENTER);
           frame.setSize(300, 200);
           frame.setVisible(true);
         }
       }
    
     
  8. What Java Champion was influential in getting the College Board to include Java programming in the advanced placement (AP) computer science exam for high school students?
     A. Kirk Pepperdine
     B. Cay Horstmann
     C. Neal Gafter
     D. Jim Weaver
     E. Ron Hitchens
     
  9. According to the Servlet Container Profile of JSR 196, Java Authentication Service Provider Interface for Containers, which of the following methods must be implemented by a Server Authentication Module (SAM)?
     A. login()
     B. authenticate()
     C. validateRequest()
     D. AccessServiceAuthenticationModuleStatus()
     E. None of the above
     
  10. True or false, the thr thread in the following program can use the garbage-collected heap?
     
       import javax.realtime.*;
    
       public class PeriodicThread {
           static RealtimeThread thr;
           static {
               int prio = PriorityScheduler.instance().getMaxPriority();
               RelativeTime period = new RelativeTime(20,0);
               thr = new NoHeapRealtimeThread(
                                       new PriorityParameters(prio),
                                       new PeriodicParameters(
                                               period),
                                               ImmortalMemory.instance()) {
                       public void run() {
                               . . .
                       }
              };
            }
            . . ..
       }
    
     
     A. True
     B. False