Questions and CORRECT Answers
Software objects share two characteristics of __________ and __________. - CORRECT
ANSWER - State, behavior
Benefits of modeling using objects in software include - CORRECT ANSWER - Code re-
use
Information-hiding
Modularity Pluggability and debugging ease
The purpose of a class in object-oriented programming environment is to model the state and
behavior of a real-world object. - CORRECT ANSWER - True
In object-oriented terms what is used as a blueprint to model a real-world object? - CORRECT
ANSWER - Class
Object-oriented programming allows for inheritance so commonly used state and behavior can
be reused. The class that is inherited from is the __________ and the new class is the
__________. - CORRECT ANSWER - Superclass, subclass
A declaration statement declares a variable. The following code is a correct example of a
declaration statement: double value = 100; - CORRECT ANSWER - True
How many superclasses can a subclass extend when using inheritance in object-oriented
programming using the Java programming language? - CORRECT ANSWER - One
When using inheritance what does the new class inherit when it is derived from another class? -
CORRECT ANSWER - State, behavior
, When implementing an interface in object-oriented programming all __________ must be
included in the source code for the class to compile. - CORRECT ANSWER - Methods
What programming best practice should be used when identifying state and behaviors that are
derived from another class or defined locally in the new class? - CORRECT ANSWER -
Comment the code
Local variables are commonly used in methods to store a temporary state. Local variables are
visible __________. - CORRECT ANSWER - Between the opening and closing braces of
the method where they are declared
Given the signature for the required main method in the Java programming language, public
static void main (String[] args), what is args called from a variable perspective? - CORRECT
ANSWER - Parameter
Compound assignment operators combine an arithmetic operator with the __________ operator.
- CORRECT ANSWER -=
An expression can comprise - CORRECT ANSWER - Variables
Operators
Method invocations
An expression statement forms a complete unit of execution with a terminating semicolon. The
following code is a correct example of an expression statement: Bicycle myBike = new Bicycle()
- CORRECT ANSWER - False
Regarding source code, a block is a group of 0...n statements balanced between - CORRECT
ANSWER -{}
When using the switch decision-making statement the break statement is required. - CORRECT
ANSWER - False