Deck 4: More Object Concepts

Full screen (f)
exit full mode
Question
You can overload methods correctly by providing different parameter lists for methods with the same name.
Use Space or
up arrow
down arrow
to flip the card.
Question
____ involves using one term to indicate diverse meanings, or writing multiple methods with the same name but with different parameter lists.

A) Referencing
B) Overloading
C) Nesting
D) Signing
Question
If you give the same name to a class's instance field and to a local method variable, the instance variable overrides the method's local variable.
Question
When you write your own constructors, you cannot write versions that receive parameters.
Question
It is illegal to declare the same variable name more than once within a block.
Question
When they have the same name, variables within ____ of a class override the class's fields.

A) packages
B) statements
C) fields
D) methods
Question
A method can receive ____ arguments, even if it is defined as needing double arguments.

A) string
B) integer
C) constructor
D) send
Question
It is a convenience to be able to use one reasonable name for ____ that are functionally identical except for argument types.

A) arguments
B) classes
C) tasks
D) packages
Question
A disadvantage of Java is the large memory requirements to store a separate copy of each variable and method for each instantiation of a class.
Question
When you properly ____ a method, you can call it providing different argument lists, and the appropriate version of the method executes.

A) declare
B) overload
C) name
D) delete
Question
When you overload a Java method, you write multiple methods with a shared name.
Question
A locally declared variable always ____ another variable with the same name elsewhere in the class.

A) creates
B) masks
C) deletes
D) uses
Question
Fields declared to be static are not always final .
Question
An alternative to importing a class is to import an entire package of classes.
Question
When you multiply an int and a double , the result is the int .
Question
When an application contains just one version of a method, you can call the method using a(n) ____ of the correct data type.

A) parameter
B) scope
C) output
D) constructor
Question
Object-oriented programmers use the term ____ when a child class contains a field or method that has the same name as one in the parent class.

A) out of scope
B) ambiguous
C) override
D) parent friendly
Question
A variable comes into existence, or ____, when you declare it.

A) goes out of scope
B) comes into scope
C) overrides scope
D) is referenced
Question
Within any class or method, the code between a pair of curly braces is called a(n) ____.

A) overload
B) argument
C) scope
D) block
Question
A block can exist entirely within another block or entirely outside and separate from another block, and sometimes blocks can overlap.
Question
The ____ statement notifies the program that you will be using the data and method names that are part of the imported class or package.

A) use
B) package
C) class
D) import
Question
In a Java ____statement, you use a wildcard symbol to represent all the classes in a package.

A) import
B) enumeration
C) package
D) default constructor
Question
When calling this() from a constructor, it must be the ____ statement within the constructor.

A) first
B) ending
C) second
D) indented
Question
You can use ____ arguments to initialize field values, but you can also use arguments for any other purpose.

A) object
B) constructor
C) data
D) field
Question
It is not necessary to create an instance of the Math class because the constants and methods of the class are ____.

A) void
B) final
C) static
D) public
Question
When you ____methods, you risk creating an ambiguous situation-one in which the compiler cannot determine which method to use.

A) use static variables in
B) use class variables in
C) finalize
D) overload
Question
If a class's only constructor requires an argument, you must provide an argument for every ____ of the class that you create.

A) parameter
B) type
C) object
D) method
Question
When you pass a(n) ____, you pass a memory address.

A) reference
B) class variable
C) value
D) static variable
Question
The reference to an object that is passed to any object's nonstatic class method is called the ____.

A) magic number
B) this reference
C) literal constant
D) reference
Question
____ variables are variables that are shared by every instantiation of a class.

A) Integer
B) Instance
C) Class
D) Time
Question
The ____ package contains is implicitly imported into Java programs and is the only automatically imported, named package.

A) javax.swing
B) java.lang
C) JOptionPane
D) System
Question
Due to automatic type promotion, when a method with a double parameter is passed an integer, the integer will be promoted to a(n) ____.

A) integer
B) short
C) boolean
D) double
Question
When an object of one class is a data field within another class, they are related by ____.

A) extension
B) scope
C) composition
D) is-a
Question
A(n) ____ is simply a folder that provides a convenient grouping for classes.

A) constructor
B) block
C) composition
D) package
Question
The compiler determines which version of a method to call by the method's ____.

A) name
B) signature
C) output
D) constructor
Question
You can use the asterisk (*) as a ____, which indicates that it can be replaced by any set of characters.

A) magic number
B) wildcard symbol
C) character symbol
D) placeholder
Question
When you instantiate an object from a class, ____ is reserved for each instance field in the class.

A) a constructor
B) a signature
C) memory
D) a field name
Question
A(n) ____ block begins immediately after the method declaration and ends at the end of the method.

A) inner
B) outer
C) nested
D) overlapped
Question
If you want all objects to share a single nonchanging value, then the field is static and ______.

A) end
B) final
C) permanent
D) class
Question
Another name for a nonstatic member class is a(n) ____.

A) static member class
B) inner class
C) local class
D) anonymous class
Question
Because the square root of a negative number is not defined, what is the result of this statement: System.out.println (Math.sqrt(-16));

A) Runtime error message
B) Syntax error
C) NaN
D) -4
Question
The java.lang package is implicitly imported into every program you write. The classes it contains are ____ that provide the basis of the Java programming language.

A) optional classes
B) static classes
C) fundamental classes
D) anonymous classes
Question
Match between columns
Using one term to indicate diverse meanings
optional classes
Using one term to indicate diverse meanings
inner block
Using one term to indicate diverse meanings
comes into scope
Using one term to indicate diverse meanings
class methods
Using one term to indicate diverse meanings
overloading
Using one term to indicate diverse meanings
Math class
Using one term to indicate diverse meanings
composition
Using one term to indicate diverse meanings
Java.time
Using one term to indicate diverse meanings
constant
Using one term to indicate diverse meanings
nested
Using one term to indicate diverse meanings
scope level
Using one term to indicate diverse meanings
shadowing
Using one term to indicate diverse meanings
NaN
Using one term to indicate diverse meanings
enumeration
Using one term to indicate diverse meanings
package
Question
Match between columns
Data type consisting of a list of values
NaN
Data type consisting of a list of values
optional classes
Data type consisting of a list of values
inner block
Data type consisting of a list of values
comes into scope
Data type consisting of a list of values
class methods
Data type consisting of a list of values
overloading
Data type consisting of a list of values
Math class
Data type consisting of a list of values
composition
Data type consisting of a list of values
Java.time
Data type consisting of a list of values
constant
Data type consisting of a list of values
nested
Data type consisting of a list of values
scope level
Data type consisting of a list of values
shadowing
Data type consisting of a list of values
enumeration
Data type consisting of a list of values
package
Question
Match between columns
Describes the relationship between classes when an object of one class is a data field within another class
optional classes
Describes the relationship between classes when an object of one class is a data field within another class
inner block
Describes the relationship between classes when an object of one class is a data field within another class
comes into scope
Describes the relationship between classes when an object of one class is a data field within another class
class methods
Describes the relationship between classes when an object of one class is a data field within another class
overloading
Describes the relationship between classes when an object of one class is a data field within another class
Math class
Describes the relationship between classes when an object of one class is a data field within another class
composition
Describes the relationship between classes when an object of one class is a data field within another class
Java.time
Describes the relationship between classes when an object of one class is a data field within another class
constant
Describes the relationship between classes when an object of one class is a data field within another class
nested
Describes the relationship between classes when an object of one class is a data field within another class
scope level
Describes the relationship between classes when an object of one class is a data field within another class
shadowing
Describes the relationship between classes when an object of one class is a data field within another class
NaN
Describes the relationship between classes when an object of one class is a data field within another class
enumeration
Describes the relationship between classes when an object of one class is a data field within another class
package
Question
Match between columns
Created using the keyword final
optional classes
Created using the keyword final
inner block
Created using the keyword final
comes into scope
Created using the keyword final
class methods
Created using the keyword final
overloading
Created using the keyword final
Math class
Created using the keyword final
composition
Created using the keyword final
Java.time
Created using the keyword final
constant
Created using the keyword final
nested
Created using the keyword final
scope level
Created using the keyword final
shadowing
Created using the keyword final
NaN
Created using the keyword final
enumeration
Created using the keyword final
package
Question
Match between columns
Library of classes
optional classes
Library of classes
inner block
Library of classes
comes into scope
Library of classes
class methods
Library of classes
overloading
Library of classes
Math class
Library of classes
composition
Library of classes
Java.time
Library of classes
constant
Library of classes
nested
Library of classes
scope level
Library of classes
shadowing
Library of classes
NaN
Library of classes
enumeration
Library of classes
package
Question
____ are local classes that have no identifier.

A) Anonymous classes
B)  Nonstatic member classes
C) Local classes
D) static member classes
Question
Match between columns
No object associated with them
optional classes
No object associated with them
inner block
No object associated with them
comes into scope
No object associated with them
class methods
No object associated with them
overloading
No object associated with them
Math class
No object associated with them
composition
No object associated with them
Java.time
No object associated with them
constant
No object associated with them
nested
No object associated with them
scope level
No object associated with them
shadowing
No object associated with them
NaN
No object associated with them
enumeration
No object associated with them
package
Question
Match between columns
Useful when working with dates and times
optional classes
Useful when working with dates and times
inner block
Useful when working with dates and times
comes into scope
Useful when working with dates and times
class methods
Useful when working with dates and times
overloading
Useful when working with dates and times
Math class
Useful when working with dates and times
composition
Useful when working with dates and times
Java.time
Useful when working with dates and times
constant
Useful when working with dates and times
nested
Useful when working with dates and times
scope level
Useful when working with dates and times
shadowing
Useful when working with dates and times
NaN
Useful when working with dates and times
enumeration
Useful when working with dates and times
package
Question
Match between columns
Defines mathematical constants such as PI
optional classes
Defines mathematical constants such as PI
inner block
Defines mathematical constants such as PI
comes into scope
Defines mathematical constants such as PI
class methods
Defines mathematical constants such as PI
overloading
Defines mathematical constants such as PI
Math class
Defines mathematical constants such as PI
composition
Defines mathematical constants such as PI
Java.time
Defines mathematical constants such as PI
constant
Defines mathematical constants such as PI
nested
Defines mathematical constants such as PI
scope level
Defines mathematical constants such as PI
shadowing
Defines mathematical constants such as PI
NaN
Defines mathematical constants such as PI
enumeration
Defines mathematical constants such as PI
package
Question
Match between columns
Must be explicitly named in an import statement
optional classes
Must be explicitly named in an import statement
inner block
Must be explicitly named in an import statement
comes into scope
Must be explicitly named in an import statement
class methods
Must be explicitly named in an import statement
overloading
Must be explicitly named in an import statement
Math class
Must be explicitly named in an import statement
composition
Must be explicitly named in an import statement
Java.time
Must be explicitly named in an import statement
constant
Must be explicitly named in an import statement
nested
Must be explicitly named in an import statement
scope level
Must be explicitly named in an import statement
shadowing
Must be explicitly named in an import statement
NaN
Must be explicitly named in an import statement
enumeration
Must be explicitly named in an import statement
package
Question
Match between columns
A variable that hides another variable
optional classes
A variable that hides another variable
inner block
A variable that hides another variable
comes into scope
A variable that hides another variable
class methods
A variable that hides another variable
overloading
A variable that hides another variable
Math class
A variable that hides another variable
composition
A variable that hides another variable
Java.time
A variable that hides another variable
constant
A variable that hides another variable
nested
A variable that hides another variable
scope level
A variable that hides another variable
shadowing
A variable that hides another variable
NaN
A variable that hides another variable
enumeration
A variable that hides another variable
package
Question
Match between columns
An inner block is completely contained within an outer block
optional classes
An inner block is completely contained within an outer block
inner block
An inner block is completely contained within an outer block
comes into scope
An inner block is completely contained within an outer block
class methods
An inner block is completely contained within an outer block
overloading
An inner block is completely contained within an outer block
Math class
An inner block is completely contained within an outer block
composition
An inner block is completely contained within an outer block
Java.time
An inner block is completely contained within an outer block
constant
An inner block is completely contained within an outer block
nested
An inner block is completely contained within an outer block
scope level
An inner block is completely contained within an outer block
shadowing
An inner block is completely contained within an outer block
NaN
An inner block is completely contained within an outer block
enumeration
An inner block is completely contained within an outer block
package
Question
Match between columns
Premises:
Responses:
optional classes
inner block
comes into scope
class methods
overloading
Math class
composition
Java.time
constant
nested
scope level
shadowing
NaN
enumeration
package
Question
Match between columns
Portion of a program where you can refer to a variable
optional classes
Portion of a program where you can refer to a variable
inner block
Portion of a program where you can refer to a variable
comes into scope
Portion of a program where you can refer to a variable
class methods
Portion of a program where you can refer to a variable
overloading
Portion of a program where you can refer to a variable
Math class
Portion of a program where you can refer to a variable
composition
Portion of a program where you can refer to a variable
Java.time
Portion of a program where you can refer to a variable
constant
Portion of a program where you can refer to a variable
nested
Portion of a program where you can refer to a variable
scope level
Portion of a program where you can refer to a variable
shadowing
Portion of a program where you can refer to a variable
NaN
Portion of a program where you can refer to a variable
enumeration
Portion of a program where you can refer to a variable
package
Question
A Java variable's scope level is its ____.

A) constructor
B) class method
C) block
D) fundamental class
Question
Match between columns
Not a number
optional classes
Not a number
inner block
Not a number
comes into scope
Not a number
class methods
Not a number
overloading
Not a number
Math class
Not a number
composition
Not a number
Java.time
Not a number
constant
Not a number
nested
Not a number
scope level
Not a number
shadowing
Not a number
NaN
Not a number
enumeration
Not a number
package
Question
The methods of LocalDate include getMonth() and getDayOfWeek() . Each of these methods returns a(n) ____, which is a data type that consists of a list of values.

A) array
B) constant
C) shadow array
D) enumeration
Question
Match between columns
A variable comes into existence
optional classes
A variable comes into existence
inner block
A variable comes into existence
comes into scope
A variable comes into existence
class methods
A variable comes into existence
overloading
A variable comes into existence
Math class
A variable comes into existence
composition
A variable comes into existence
Java.time
A variable comes into existence
constant
A variable comes into existence
nested
A variable comes into existence
scope level
A variable comes into existence
shadowing
A variable comes into existence
NaN
A variable comes into existence
enumeration
A variable comes into existence
package
Question
Describe the impact that blocks and methods have on variables with the same name.
Question
  In the above code, if the simpleMethod() method received a double or integer value, the resulting output is Method receives double parameter. Explain how Java can promote one data type to another when a parameter is passed to a method.<div style=padding-top: 35px> In the above code, if the simpleMethod() method received a double or integer value, the resulting output is "Method receives double parameter". Explain how Java can promote one data type to another when a parameter is passed to a method.
Question
Describe how a Java variable comes into and out of scope.
Question
What does it mean when a variable overrides another variable? 
Question
  The Student class above will allow Student information to be constructed in various ways, but is repetitive. How could you use the this reference to reduce the amount of repetitious code and make it less error-prone?<div style=padding-top: 35px> The Student class above will allow Student information to be constructed in various ways, but is repetitive. How could you use the this reference to reduce the amount of repetitious code and make it less error-prone?
Question
What is automatic type promotion in method calls? Give an example of how this works.
Question
Describe a block and define an outer block and an inner block.
Question
What is the difference between class variables and instance variables?
Question
What is overloading a method? What conditions must be satisfied in the parameter lists of an overloaded method?
Question
public class StudentScores
{
   private int ScoreOne;
   private int ScoreTwo;
   private int ScoreThree;
____
____
____
____
____
}
Using the code above, fill in the blank lines provided to create a constructor that will require parameters for the three score data fields. Be sure to include the necessary brackets and semicolons.
Question
What does a programmer need to know in order to use two variables with the same name in a class?
Question
  In the above code, what happens to the value of aNumber when the main() method is executed? What happens to the value of aNumber when the firstMethod and secondMethod methods are executed?<div style=padding-top: 35px> In the above code, what happens to the value of aNumber when the main() method is executed? What happens to the value of aNumber when the firstMethod and secondMethod methods are executed?
Question
What is a reference and what is the meaning of the keyword this ?
Question
  In the above code, what would happen if calculateInterest was passed the values of 100 for the bal and .10 for the interest rate? What would happen if calculateInterest was passed the values of 100 for the bal and 10 for the interest rate? Why is it a problem when these values are passed to the calculateInterest method, and what would be a possible solution to fix the problem?<div style=padding-top: 35px> In the above code, what would happen if calculateInterest was passed the values of 100 for the bal and .10 for the interest rate? What would happen if calculateInterest was passed the values of 100 for the bal and 10 for the interest rate? Why is it a problem when these values are passed to the calculateInterest method, and what would be a possible solution to fix the problem?
Question
int aMethod(int x)
void aMethod(int x)
In the above statements, explain why these two methods are illegal in the class.
Question
What is the phenomenon called shadowing?
Question
  Explain why the highlighted statements will result in an illegal action.<div style=padding-top: 35px> Explain why the highlighted statements will result in an illegal action.
Question
List and describe the four types of nested classes.
Question
List the three things you can do that allow you to use prewritten classes.
Question
Explain the java.lang package and why it is important. 
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/84
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 4: More Object Concepts
1
You can overload methods correctly by providing different parameter lists for methods with the same name.
True
2
____ involves using one term to indicate diverse meanings, or writing multiple methods with the same name but with different parameter lists.

A) Referencing
B) Overloading
C) Nesting
D) Signing
B
3
If you give the same name to a class's instance field and to a local method variable, the instance variable overrides the method's local variable.
False
4
When you write your own constructors, you cannot write versions that receive parameters.
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
5
It is illegal to declare the same variable name more than once within a block.
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
6
When they have the same name, variables within ____ of a class override the class's fields.

A) packages
B) statements
C) fields
D) methods
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
7
A method can receive ____ arguments, even if it is defined as needing double arguments.

A) string
B) integer
C) constructor
D) send
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
8
It is a convenience to be able to use one reasonable name for ____ that are functionally identical except for argument types.

A) arguments
B) classes
C) tasks
D) packages
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
9
A disadvantage of Java is the large memory requirements to store a separate copy of each variable and method for each instantiation of a class.
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
10
When you properly ____ a method, you can call it providing different argument lists, and the appropriate version of the method executes.

A) declare
B) overload
C) name
D) delete
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
11
When you overload a Java method, you write multiple methods with a shared name.
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
12
A locally declared variable always ____ another variable with the same name elsewhere in the class.

A) creates
B) masks
C) deletes
D) uses
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
13
Fields declared to be static are not always final .
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
14
An alternative to importing a class is to import an entire package of classes.
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
15
When you multiply an int and a double , the result is the int .
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
16
When an application contains just one version of a method, you can call the method using a(n) ____ of the correct data type.

A) parameter
B) scope
C) output
D) constructor
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
17
Object-oriented programmers use the term ____ when a child class contains a field or method that has the same name as one in the parent class.

A) out of scope
B) ambiguous
C) override
D) parent friendly
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
18
A variable comes into existence, or ____, when you declare it.

A) goes out of scope
B) comes into scope
C) overrides scope
D) is referenced
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
19
Within any class or method, the code between a pair of curly braces is called a(n) ____.

A) overload
B) argument
C) scope
D) block
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
20
A block can exist entirely within another block or entirely outside and separate from another block, and sometimes blocks can overlap.
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
21
The ____ statement notifies the program that you will be using the data and method names that are part of the imported class or package.

A) use
B) package
C) class
D) import
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
22
In a Java ____statement, you use a wildcard symbol to represent all the classes in a package.

A) import
B) enumeration
C) package
D) default constructor
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
23
When calling this() from a constructor, it must be the ____ statement within the constructor.

A) first
B) ending
C) second
D) indented
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
24
You can use ____ arguments to initialize field values, but you can also use arguments for any other purpose.

A) object
B) constructor
C) data
D) field
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
25
It is not necessary to create an instance of the Math class because the constants and methods of the class are ____.

A) void
B) final
C) static
D) public
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
26
When you ____methods, you risk creating an ambiguous situation-one in which the compiler cannot determine which method to use.

A) use static variables in
B) use class variables in
C) finalize
D) overload
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
27
If a class's only constructor requires an argument, you must provide an argument for every ____ of the class that you create.

A) parameter
B) type
C) object
D) method
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
28
When you pass a(n) ____, you pass a memory address.

A) reference
B) class variable
C) value
D) static variable
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
29
The reference to an object that is passed to any object's nonstatic class method is called the ____.

A) magic number
B) this reference
C) literal constant
D) reference
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
30
____ variables are variables that are shared by every instantiation of a class.

A) Integer
B) Instance
C) Class
D) Time
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
31
The ____ package contains is implicitly imported into Java programs and is the only automatically imported, named package.

A) javax.swing
B) java.lang
C) JOptionPane
D) System
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
32
Due to automatic type promotion, when a method with a double parameter is passed an integer, the integer will be promoted to a(n) ____.

A) integer
B) short
C) boolean
D) double
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
33
When an object of one class is a data field within another class, they are related by ____.

A) extension
B) scope
C) composition
D) is-a
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
34
A(n) ____ is simply a folder that provides a convenient grouping for classes.

A) constructor
B) block
C) composition
D) package
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
35
The compiler determines which version of a method to call by the method's ____.

A) name
B) signature
C) output
D) constructor
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
36
You can use the asterisk (*) as a ____, which indicates that it can be replaced by any set of characters.

A) magic number
B) wildcard symbol
C) character symbol
D) placeholder
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
37
When you instantiate an object from a class, ____ is reserved for each instance field in the class.

A) a constructor
B) a signature
C) memory
D) a field name
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
38
A(n) ____ block begins immediately after the method declaration and ends at the end of the method.

A) inner
B) outer
C) nested
D) overlapped
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
39
If you want all objects to share a single nonchanging value, then the field is static and ______.

A) end
B) final
C) permanent
D) class
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
40
Another name for a nonstatic member class is a(n) ____.

A) static member class
B) inner class
C) local class
D) anonymous class
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
41
Because the square root of a negative number is not defined, what is the result of this statement: System.out.println (Math.sqrt(-16));

A) Runtime error message
B) Syntax error
C) NaN
D) -4
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
42
The java.lang package is implicitly imported into every program you write. The classes it contains are ____ that provide the basis of the Java programming language.

A) optional classes
B) static classes
C) fundamental classes
D) anonymous classes
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
43
Match between columns
Using one term to indicate diverse meanings
optional classes
Using one term to indicate diverse meanings
inner block
Using one term to indicate diverse meanings
comes into scope
Using one term to indicate diverse meanings
class methods
Using one term to indicate diverse meanings
overloading
Using one term to indicate diverse meanings
Math class
Using one term to indicate diverse meanings
composition
Using one term to indicate diverse meanings
Java.time
Using one term to indicate diverse meanings
constant
Using one term to indicate diverse meanings
nested
Using one term to indicate diverse meanings
scope level
Using one term to indicate diverse meanings
shadowing
Using one term to indicate diverse meanings
NaN
Using one term to indicate diverse meanings
enumeration
Using one term to indicate diverse meanings
package
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
44
Match between columns
Data type consisting of a list of values
NaN
Data type consisting of a list of values
optional classes
Data type consisting of a list of values
inner block
Data type consisting of a list of values
comes into scope
Data type consisting of a list of values
class methods
Data type consisting of a list of values
overloading
Data type consisting of a list of values
Math class
Data type consisting of a list of values
composition
Data type consisting of a list of values
Java.time
Data type consisting of a list of values
constant
Data type consisting of a list of values
nested
Data type consisting of a list of values
scope level
Data type consisting of a list of values
shadowing
Data type consisting of a list of values
enumeration
Data type consisting of a list of values
package
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
45
Match between columns
Describes the relationship between classes when an object of one class is a data field within another class
optional classes
Describes the relationship between classes when an object of one class is a data field within another class
inner block
Describes the relationship between classes when an object of one class is a data field within another class
comes into scope
Describes the relationship between classes when an object of one class is a data field within another class
class methods
Describes the relationship between classes when an object of one class is a data field within another class
overloading
Describes the relationship between classes when an object of one class is a data field within another class
Math class
Describes the relationship between classes when an object of one class is a data field within another class
composition
Describes the relationship between classes when an object of one class is a data field within another class
Java.time
Describes the relationship between classes when an object of one class is a data field within another class
constant
Describes the relationship between classes when an object of one class is a data field within another class
nested
Describes the relationship between classes when an object of one class is a data field within another class
scope level
Describes the relationship between classes when an object of one class is a data field within another class
shadowing
Describes the relationship between classes when an object of one class is a data field within another class
NaN
Describes the relationship between classes when an object of one class is a data field within another class
enumeration
Describes the relationship between classes when an object of one class is a data field within another class
package
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
46
Match between columns
Created using the keyword final
optional classes
Created using the keyword final
inner block
Created using the keyword final
comes into scope
Created using the keyword final
class methods
Created using the keyword final
overloading
Created using the keyword final
Math class
Created using the keyword final
composition
Created using the keyword final
Java.time
Created using the keyword final
constant
Created using the keyword final
nested
Created using the keyword final
scope level
Created using the keyword final
shadowing
Created using the keyword final
NaN
Created using the keyword final
enumeration
Created using the keyword final
package
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
47
Match between columns
Library of classes
optional classes
Library of classes
inner block
Library of classes
comes into scope
Library of classes
class methods
Library of classes
overloading
Library of classes
Math class
Library of classes
composition
Library of classes
Java.time
Library of classes
constant
Library of classes
nested
Library of classes
scope level
Library of classes
shadowing
Library of classes
NaN
Library of classes
enumeration
Library of classes
package
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
48
____ are local classes that have no identifier.

A) Anonymous classes
B)  Nonstatic member classes
C) Local classes
D) static member classes
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
49
Match between columns
No object associated with them
optional classes
No object associated with them
inner block
No object associated with them
comes into scope
No object associated with them
class methods
No object associated with them
overloading
No object associated with them
Math class
No object associated with them
composition
No object associated with them
Java.time
No object associated with them
constant
No object associated with them
nested
No object associated with them
scope level
No object associated with them
shadowing
No object associated with them
NaN
No object associated with them
enumeration
No object associated with them
package
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
50
Match between columns
Useful when working with dates and times
optional classes
Useful when working with dates and times
inner block
Useful when working with dates and times
comes into scope
Useful when working with dates and times
class methods
Useful when working with dates and times
overloading
Useful when working with dates and times
Math class
Useful when working with dates and times
composition
Useful when working with dates and times
Java.time
Useful when working with dates and times
constant
Useful when working with dates and times
nested
Useful when working with dates and times
scope level
Useful when working with dates and times
shadowing
Useful when working with dates and times
NaN
Useful when working with dates and times
enumeration
Useful when working with dates and times
package
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
51
Match between columns
Defines mathematical constants such as PI
optional classes
Defines mathematical constants such as PI
inner block
Defines mathematical constants such as PI
comes into scope
Defines mathematical constants such as PI
class methods
Defines mathematical constants such as PI
overloading
Defines mathematical constants such as PI
Math class
Defines mathematical constants such as PI
composition
Defines mathematical constants such as PI
Java.time
Defines mathematical constants such as PI
constant
Defines mathematical constants such as PI
nested
Defines mathematical constants such as PI
scope level
Defines mathematical constants such as PI
shadowing
Defines mathematical constants such as PI
NaN
Defines mathematical constants such as PI
enumeration
Defines mathematical constants such as PI
package
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
52
Match between columns
Must be explicitly named in an import statement
optional classes
Must be explicitly named in an import statement
inner block
Must be explicitly named in an import statement
comes into scope
Must be explicitly named in an import statement
class methods
Must be explicitly named in an import statement
overloading
Must be explicitly named in an import statement
Math class
Must be explicitly named in an import statement
composition
Must be explicitly named in an import statement
Java.time
Must be explicitly named in an import statement
constant
Must be explicitly named in an import statement
nested
Must be explicitly named in an import statement
scope level
Must be explicitly named in an import statement
shadowing
Must be explicitly named in an import statement
NaN
Must be explicitly named in an import statement
enumeration
Must be explicitly named in an import statement
package
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
53
Match between columns
A variable that hides another variable
optional classes
A variable that hides another variable
inner block
A variable that hides another variable
comes into scope
A variable that hides another variable
class methods
A variable that hides another variable
overloading
A variable that hides another variable
Math class
A variable that hides another variable
composition
A variable that hides another variable
Java.time
A variable that hides another variable
constant
A variable that hides another variable
nested
A variable that hides another variable
scope level
A variable that hides another variable
shadowing
A variable that hides another variable
NaN
A variable that hides another variable
enumeration
A variable that hides another variable
package
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
54
Match between columns
An inner block is completely contained within an outer block
optional classes
An inner block is completely contained within an outer block
inner block
An inner block is completely contained within an outer block
comes into scope
An inner block is completely contained within an outer block
class methods
An inner block is completely contained within an outer block
overloading
An inner block is completely contained within an outer block
Math class
An inner block is completely contained within an outer block
composition
An inner block is completely contained within an outer block
Java.time
An inner block is completely contained within an outer block
constant
An inner block is completely contained within an outer block
nested
An inner block is completely contained within an outer block
scope level
An inner block is completely contained within an outer block
shadowing
An inner block is completely contained within an outer block
NaN
An inner block is completely contained within an outer block
enumeration
An inner block is completely contained within an outer block
package
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
55
Match between columns
Premises:
Responses:
optional classes
inner block
comes into scope
class methods
overloading
Math class
composition
Java.time
constant
nested
scope level
shadowing
NaN
enumeration
package
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
56
Match between columns
Portion of a program where you can refer to a variable
optional classes
Portion of a program where you can refer to a variable
inner block
Portion of a program where you can refer to a variable
comes into scope
Portion of a program where you can refer to a variable
class methods
Portion of a program where you can refer to a variable
overloading
Portion of a program where you can refer to a variable
Math class
Portion of a program where you can refer to a variable
composition
Portion of a program where you can refer to a variable
Java.time
Portion of a program where you can refer to a variable
constant
Portion of a program where you can refer to a variable
nested
Portion of a program where you can refer to a variable
scope level
Portion of a program where you can refer to a variable
shadowing
Portion of a program where you can refer to a variable
NaN
Portion of a program where you can refer to a variable
enumeration
Portion of a program where you can refer to a variable
package
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
57
A Java variable's scope level is its ____.

A) constructor
B) class method
C) block
D) fundamental class
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
58
Match between columns
Not a number
optional classes
Not a number
inner block
Not a number
comes into scope
Not a number
class methods
Not a number
overloading
Not a number
Math class
Not a number
composition
Not a number
Java.time
Not a number
constant
Not a number
nested
Not a number
scope level
Not a number
shadowing
Not a number
NaN
Not a number
enumeration
Not a number
package
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
59
The methods of LocalDate include getMonth() and getDayOfWeek() . Each of these methods returns a(n) ____, which is a data type that consists of a list of values.

A) array
B) constant
C) shadow array
D) enumeration
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
60
Match between columns
A variable comes into existence
optional classes
A variable comes into existence
inner block
A variable comes into existence
comes into scope
A variable comes into existence
class methods
A variable comes into existence
overloading
A variable comes into existence
Math class
A variable comes into existence
composition
A variable comes into existence
Java.time
A variable comes into existence
constant
A variable comes into existence
nested
A variable comes into existence
scope level
A variable comes into existence
shadowing
A variable comes into existence
NaN
A variable comes into existence
enumeration
A variable comes into existence
package
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
61
Describe the impact that blocks and methods have on variables with the same name.
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
62
  In the above code, if the simpleMethod() method received a double or integer value, the resulting output is Method receives double parameter. Explain how Java can promote one data type to another when a parameter is passed to a method. In the above code, if the simpleMethod() method received a double or integer value, the resulting output is "Method receives double parameter". Explain how Java can promote one data type to another when a parameter is passed to a method.
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
63
Describe how a Java variable comes into and out of scope.
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
64
What does it mean when a variable overrides another variable? 
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
65
  The Student class above will allow Student information to be constructed in various ways, but is repetitive. How could you use the this reference to reduce the amount of repetitious code and make it less error-prone? The Student class above will allow Student information to be constructed in various ways, but is repetitive. How could you use the this reference to reduce the amount of repetitious code and make it less error-prone?
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
66
What is automatic type promotion in method calls? Give an example of how this works.
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
67
Describe a block and define an outer block and an inner block.
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
68
What is the difference between class variables and instance variables?
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
69
What is overloading a method? What conditions must be satisfied in the parameter lists of an overloaded method?
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
70
public class StudentScores
{
   private int ScoreOne;
   private int ScoreTwo;
   private int ScoreThree;
____
____
____
____
____
}
Using the code above, fill in the blank lines provided to create a constructor that will require parameters for the three score data fields. Be sure to include the necessary brackets and semicolons.
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
71
What does a programmer need to know in order to use two variables with the same name in a class?
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
72
  In the above code, what happens to the value of aNumber when the main() method is executed? What happens to the value of aNumber when the firstMethod and secondMethod methods are executed? In the above code, what happens to the value of aNumber when the main() method is executed? What happens to the value of aNumber when the firstMethod and secondMethod methods are executed?
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
73
What is a reference and what is the meaning of the keyword this ?
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
74
  In the above code, what would happen if calculateInterest was passed the values of 100 for the bal and .10 for the interest rate? What would happen if calculateInterest was passed the values of 100 for the bal and 10 for the interest rate? Why is it a problem when these values are passed to the calculateInterest method, and what would be a possible solution to fix the problem? In the above code, what would happen if calculateInterest was passed the values of 100 for the bal and .10 for the interest rate? What would happen if calculateInterest was passed the values of 100 for the bal and 10 for the interest rate? Why is it a problem when these values are passed to the calculateInterest method, and what would be a possible solution to fix the problem?
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
75
int aMethod(int x)
void aMethod(int x)
In the above statements, explain why these two methods are illegal in the class.
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
76
What is the phenomenon called shadowing?
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
77
  Explain why the highlighted statements will result in an illegal action. Explain why the highlighted statements will result in an illegal action.
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
78
List and describe the four types of nested classes.
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
79
List the three things you can do that allow you to use prewritten classes.
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
80
Explain the java.lang package and why it is important. 
Unlock Deck
Unlock for access to all 84 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 84 flashcards in this deck.