CIT 591 First Quiz
Fall 2001, Dave Matuszek
Name __________________________________________

Please keep all answers short and legible. Do not volunteer information that was not asked for. Where appropriate, distinguish clearly between capital letters and lowercase letters.

  1. What keyword tells Java that your class is a subclass of some other class? _____________________

  2. The primitive type ______________________ has exactly two values, true and false.

  3. In BlueJ, what does it mean when a class is striped?




  4. What happens if your program is running in BlueJ and you click on the turning red-and-white striped "candy cane" progress bar?




  5. Rewrite the following names as they should be written in Java. Distinguish clearly between capital letters and lowercase letters.
    1. The boolean variable door_is_open ______________________________

    2. The method openthedoor ______________________________

    3. The class garagedoor ______________________________

    4. The object variable my_garagedoor ______________________________

  6. In Java, we don't call a function, we _______________________________ to ____________________.

  7. True (T) or false (F):
    1. ___ A class inherits the fields, methods, and constructors of its superclass.
    2. ___ The declaration int i causes space to be allocated for an integer variable.
    3. ___ The declaration String s does not cause space to be allocated for a String variable.
    4. ___ When indenting Java statements, you should use hard tabs instead of soft tabs.
    5. ___ When drawing in Java, the (0, 0) point is the bottom left-hand corner.
    6. ___ { } is a legal statement in Java.

  8. Each of the following statements contains a syntax error. Very briefly, tell what is wrong with each statement.

    1. if (x - 1) y = 2 * x;
       
    2. while (x > y) { x--; y++ }
       
    3. for (int i = 0; i++; i < 10)
           System.out.println(i);

       
    4. If (m < 0) m = -m;