Java Basics

Name _____________________________

OOP Terminology Questions

Choose the most appropriate answer from this list to identify each of the program elements below.

  1. Class name
  2. Instance method name.
  3. Static method name.
  4. Constructor.
  5. Local variable name.
  6. Instance variable name.
  7. Static variable name.
  8. Formal parameter name.
  9. Actual argument.
  10. None of the above.

Questions

All of these questions are about the Hammurabi source code. See Programming: Hammurabi Game I. Write the letter of the most appropriate choice from the above list. Some choices may occur more than once, and some may never be used.

  1. ____ JOptionPane (Hammurabi line 23)
  2. ____ showMessageDialog (Hammurabi line 23)
  3. ____ null (Hammurabi line 23)
  4. ____ food (Hammurabi line 26)
  5. ____ MIN_GRAIN_TO_SURVIVE (Kingdom line 11)
  6. ____ myYear (Kingdom line 21)
  7. ____ getGrain (Kingdom line 25)
  8. ____ simulateOneYear (Kingdom line 43)
  9. ____ food (Kingdom line 43)
  10. ____ showMessageDialog (Kingdom line 23)