CS 112a
Fall 2004
Ileana Streinu

2 Minute Quiz #2


  1. Write your name on a blank piece of paper.
  2. List the methods which have to be present in your java code in order to be able to use buttons (just the name(s)).
  3. List the methods which have to be present in your java code in order to be able to use graphics (just the name(s)).
  4. Which of the following two Java instructions prints on the Java console, and which one draws on the applet screen?

    System.out.println("Hello!");
    drawString("Hello", 10,10);
  5. Write down a Java statement which creates a new Button named "Start" and assigns it to a variable named start.