Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1a) The state of an object refers to the data it stores.
- 1b) The behavior of an object is defined by the action and communication it provides.
- 2. Good programming style dictates that the state of an object can only be changed through its behavior.
- 3a) Protecting an object's data is called encapsulation. Encapsulation is also called information hiding.
- 3b) Client code refers to an application that uses one or more classes.
- 3c) The process of creating clearly defined functions, or behavior, for a class is sometimes called functional decomposition.
- 3d) Constructors are used to initializing variables in a class.
- 3e) Variables and methods are called the members of a class.
- 3f) Declaring a variable as private makes it visible to the class, but not to the client code.
- 3g)Accessor methods are called to determine the value of a variable.
- 3h) A modified method is called to change the value of a variable.
- 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.
- 3j) Constructors can be overloaded to provide more options for instantiating an object.
- 4a) Each object, or instance, of a class has its own copy of variables called instance variables.
- 4b) A class variable is declared with the keyword static and only one copy is maintained for all objects to refer to.
- 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.
- 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