Advertisement
JackHoughton00

Part Eight Written Work

Apr 27th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. 1a) The state of an object refers to the data it stores.
  2. 1b) The behavior of an object is defined by the action and communication it provides.
  3.  
  4. 2. Good programming style dictates that the state of an object can only be changed through its behavior.
  5.  
  6. 3a) Protecting an object's data is called encapsulation. Encapsulation is also called information hiding.
  7. 3b) Client code refers to an application that uses one or more classes.
  8. 3c) The process of creating clearly defined functions, or behavior, for a class is sometimes called functional decomposition.
  9. 3d) Constructors are used to initializing variables in a class.
  10. 3e) Variables and methods are called the members of a class.
  11. 3f) Declaring a variable as private makes it visible to the class, but not to the client code.
  12. 3g)Accessor methods are called to determine the value of a variable.
  13. 3h) A modified method is called to change the value of a variable.
  14. 3i) Helper methods are called from within a class by other methods. They are used to help complete a task and have access level private.
  15. 3j) Constructors can be overloaded to provide more options for instantiating an object.
  16.  
  17. 4a) Each object, or instance, of a class has its own copy of variables called instance variables.
  18. 4b) A class variable is declared with the keyword static and only one copy is maintained for all objects to refer to.
  19. 4c) Methods can be either instance methods or class methods. Accessor and modifier methods are instance methods because they change the state of an object.
  20. 4d) Chapter 7 introduced class methods that are declared with the keyword static. Call methods can be called from the class itself, rather than an object of the class, to perform a task.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement