2: Chapter 8 Flashcards
Object-oriented programming
Reasoning about a program as a set of objects rather than as a set of action.
Object
A programming entity that contains state (data) and behavior (methods).
State
A set of values (internal data) stored in an object.
Behavior
A set of actions an object can perform, often reporting or modifying its internal state.
Client (or client code)
Code that interacts with a class or objects of that class.
Field
A variable inside an object that makes ip part of its internal state.
Instance method
A method inside an object that operates on that object.
Implicit parameter
The object that is referenced during an instance method call.
Mutator
An instance method that modifies the object’s internal state.
Accessor
An instance method that provides information about the state of an object without modifying it.
this
A Java keyword that allows you to refer to the implicit parameter inside a class.
Encapsulation
Hiding the implementation details of an object from the clients of the object.
Abstraction
Focusing on essential properties rather than inner details.
Class invariant
An assertion about an object’s state that is true for the lifetime of that object.
A description of something that must always be true of any instances of the class.
Cohesion
The extent to which the code for a class represents a single abstraction.