Chapter 2: Using Objects Flashcards
object
A value of a class type.
methods
A sequence of statements that has a name, may have parameter variables, and may return a value. A method can be invoked any number of times, with different values for its parameter variables.
class
A programmer-defined data type.
variable
A symbol in a program that identifies a storage location that can hold different values.
initialize
Set a variable to a well-defined value when it is created.
integer
A number that cannot have a fractional part.
floating-point numbers
A number that can have a fractional part.
case sensitive
Distinguishing upper- and lowercase characters.
reserved words
A word that has a special meaning in a programming language and there-
fore cannot be used as a name by the programmer.
comments
An explanation to help the human reader understand a section of a program; ignored by the compiler.
uninitialized variable
A variable that has not been set to a particular value. In Java, using an uninitialized local variable is a syntax error.
public interface
The features (methods, variables, and nested types) of a class that are accessible to all clients.
argument
A value supplied in a method call, or one of the values combined by an operator.
void
A reserved word indicating no type or an unknown type.
overloading
Giving more than one meaning to a method name.
construction
Setting a newly allocated object to an initial state.
accessor method
A method that accesses an object but does not change it.
mutator method
A method that changes the state of an object.
API documentation
Information about each class in the Java library.
packages
A collection of related classes. The import statement is used to access one or more classes in a package.
object reference
A value that denotes the location of an object in memory. In Java, a variable whose type is a class contains a reference to an object of that class.
frame
A window with a border and a title bar.
component (User-interface component)
A building block for a graphical user interface, such as a but- ton or a text field. User-interface components are used to present information to the user and allow the user to enter information to the program.
cast
Explicitly converting a value from one type to a different type. For example, the cast from a floating-point number x to an integer is expressed in Java by the cast notation (int) x.
inner class
A class that is defined inside another class.