Midterm Exam Review Questions

  1. What is the difference between extending a base class and implementing an interface? When is it appropriate and/or necessary to do either of these?
  2. What is an event handler? What role does it play in a program?
  3. Explain how to set up a listener to respond to events. What are some of the kinds of listeners?
  4. How do you use the Graphics class to draw in a panel?
  5. How do you use a model class to populate a JList with items?
  6. Explain how to set up and use a dialog box using the NetBeans GUI designer.
  7. How do you go about creating and using your own exception type? Why would you want to create a new exception type?
  8. Suppose you wanted to write some code to read a list of ints from a binary file on disk. To do this you would use the File, FileInputStream, and DataInputStream classes. What role does each of those three classes play?
  9. What is an ArrayList? How do you use it? How does an ArrayList differ from an array?
  10. What is an Iterator? How do you use it?
  11. Explain what the TreeMap class does and how to use it.