|CIT 591 Sixth Quiz
Fall 2001, Dave Matuszek
All answers must be kept brief. Points may be taken off for unnecessarily long
or detailed answers.
- In order to write objects to a file, what interface must those objects implement?
- What kind of memory (or "knowledge") does a pure state machine
use to keep track of the current state of the computation?
the current state
- If a pure state machine does not produce any output, how can you get any
result from running it?
observing which state it ends in
- What control structures would you use in order to implement a state machine
switch statement embedded in some kind of loop
- What does the String method
whitespace from both ends of a String
- What is the value of the expression
- When should you use a
StringBuffer instead of a
you need to make a lot of changes to the string
- What happens when the capacity of a
StringBuffer is exceeded?
is automatically copied to a new, larger capacity area
- What are the two ways of creating Threads?
the Thread class
- What are the four states of a Thread? (Just name them, don't describe them.)
running, waiting, dead
- When you create and start a new Thread, which method does the new Thread
- What keyword is used to prevent more than one Thread from accessing an object
at the same time?
- Name four of the five Stack methods.
four of: push, pop, peek (not peep!), empty, and search