Chapter 7 - Terminology Flashcards
The members of a Java class include its:
instance variables, class variables, and methods.
One copy of each instance variable is created for every:
object instantiated from the class.
The ____ access modifier allows the class or member to be accessed by other classes.
public
The _____ access modifier specifies that the class or member can be accessed only by other members of the same class.
private
_____ access allows other classes in the same package or folder to access the class or class members.
Package
Classes, constructors, final class variables, and class methods typically are declared as ____, and instance variables typically are declared as ____.
- public
2. private
Instance variables reflect the properties that all ____ will have in common.
objects
____ variables are defined by specifying an access modifier, data type, identifier, and, optionally, an initial value.
Instance
A method is defined by providing:
a method header
which specifies the access modifier, a return type, the method name, and a parameter list.
A method with a ____ return type does not return a value.
void
True or false? Instance variables and methods have class scope in that they can be accessed anywhere in the class.
True
A method can be overloaded by defining another method with the same name but a different signature; that is, ________.
with a different number of parameters or with parameters of different data types.
______ are responsible for initializing the instance variables of the class.
Constructors
If we don’t provide a constructor, the compiler provides a ______, which is a constructor that takes no arguments.
default constructor
_____ methods are named getIV, where IV is an instance variable name; the return data type is the same as the instance variable, and the body of the method simply returns the value of the instance variable.
Accessor