IT 114: Introduction to Java
Answers to Class 30 Ungraded Quiz

  1. What do you call the practice of hiding the internal details of how a class works from users of that class?
    encapsulation
  2. What keyword do you use to implement data-hiding for a field?
    private
  3. Can a method throw an exception?
    yes
  4. How to you implement data-hiding for a field?
    declare it private not public
  5. What methods must we create if we implement data-hiding for fields?
    getters and setters