CIT 591 Third Quiz
Fall 2001, Dave Matuszek
Name __________________________________________
  1. What kind of Layout is described by each of the following?
    You can put up to five components in it: BorderLayout
    You specify how many rows and columns it has: GridLayout
    You add components to the NORTH, EAST, etc.: BorderLayout
    Components are made as small as possible: FlowLayout
    Arrangement of components depends on size of the container: FlowLayout

  2. Name two kinds of Component (capitalization must be correct).
    Any of: Container, Frame, Window, Panel, Applet, Button, Checkbox, CheckboxGroup, Choice, Label, List, Scrollbar,TextArea, TextField

  3. When you say that a class implements an interface, what are you promising that the class will do?
    Define all of the methods declared in the interface.


  4. If you declare a method without defining it (that is, without providing a method body), it is an abstract method.

  5. What, briefly, is Style Rule 1?

    Adhere to the style of the original.

  6. In RabbitHunt, what value is returned by the method call Model.turn(Model.N, 4) ?
    Model.S

  7. If ch is a char, the following statement is syntactically incorrect because the expression on the right yields an int, not a char. Fix the statement. Do not put in additional statements that I did not ask for.
              ch = ch + 1;
                        ch = (char)(ch + 1);

  8. What value is computed by each of the following expressions?
    37 % 2     1 n + 5 > n     true
    (int) 12.98     12 2 + 2 == 4 ? 'a' : 'b'     'a'
    10 << 2     40 w = 3     3 (or 3.0)

  9. What method is used by System.out.println to get the string representation of objects?
    public String toString()

  10. You overload a method by writing another method with the same name; what must be different about the new method?
    The signature; or, the types, number, and order of the parameters