Programming Java Chapter 3 (2)

25 July 2022
4.7 (114 reviews)
10 test answers

Unlock all answers in this set

Unlock answers (6)
question
class
answer
One or more objects may be created from a(n): -field -class -method -instance
question
primitive variable
answer
When you are working with a ____________, you are using a storage location that holds a piece of data. -primitive variable -reference variable -numeric literal -binary number
question
object names
answer
A UML diagram does not contain: -the class name. -the method names. -the field names. -object names
question
using the private access specifier on the class fields
answer
Data hiding, which means that critical data stored inside the object is protected from code outside the object, is accomplished in Java by: -using the public access specifier on the class methods -using the private access specifier on the class methods -using the private access specifier on the class definition -using the private access specifier on the class fields
question
-the instance methods of the same class
answer
The scope of a private instance field is: -the instance methods of the same class -inside the class, but not inside any method -inside the parentheses of a method header -the method in which they are defined
question
they have different parameter lists
answer
Two or more methods in a class may have the same name as long as: -they have different return types -they have different parameter lists -they have different return types, but the same parameter list -you cannot have two methods with the same name
question
instance
answer
Another term for an object of a class is -access specifier -instance -member -method
question
class name; attributes or fields; methods
answer
In your textbook the general layout of a UML diagram is a box that is divided into three sections. The top section has the _______; the middle section holds _______; the bottom section holds _______. -class name; attributes or fields; methods -class name; object name; methods -object name; attributes or fields; methods -object name; methods; attributes or fields
question
the object's memory address
answer
When an object is passed as an argument to a method, what is passed into the method's parameter variable? -the class name -the object's memory address -the values for each field -the method names
question
have the same name, but different parameter lists
answer
Overloading means multiple methods in the same class -have the same name, but different return types -have different names, but the same parameter list -have the same name, but different parameter lists -perform the same function