Exam 4: More Object Concepts

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

It is not necessary to create an instance of the Math class because the constants and methods of the class are ____.

(Multiple Choice)
4.8/5
(39)

An alternative to importing a class is to import an entire package of classes.

(True/False)
4.8/5
(39)

Another name for a nonstatic member class is a(n) ____.

(Multiple Choice)
4.9/5
(41)

When calling this() from a constructor, it must be the ____ statement within the constructor.

(Multiple Choice)
4.8/5
(35)
Match each term with the correct statement below.
Premises:
Portion of a program where you can refer to a variable
Responses:
shadowing
package
constant
Correct Answer:
Verified
Premises:
Responses:
Portion of a program where you can refer to a variable
shadowing
(Matching)
4.9/5
(43)

When an application contains just one version of a method, you can call the method using a(n) ____ of the correct data type.

(Multiple Choice)
4.8/5
(31)

It is illegal to declare the same variable name more than once within a block.

(True/False)
4.9/5
(24)
Match each term with the correct statement below.
Premises:
A variable comes into existence
Responses:
nested
NaN
comes into scope
Correct Answer:
Verified
Premises:
Responses:
A variable comes into existence
nested
(Matching)
4.9/5
(39)

When you write your own constructors, you cannot write versions that receive parameters.

(True/False)
4.7/5
(41)

  Explain and describe the this reference. How is the this reference used in each of the above methods? Explain and describe the this reference. How is the this reference used in each of the above methods?

(Essay)
4.9/5
(36)

When you ____methods, you risk creating an ambiguous situation-one in which the compiler cannot determine which method to use.

(Multiple Choice)
4.9/5
(31)

  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?

(Essay)
4.8/5
(36)
Match each term with the correct statement below.
Premises:
Describes the relationship between classes when an object of one class is a data field within another class
Responses:
optional classes
constant
nested
Correct Answer:
Verified
Premises:
Responses:
Describes the relationship between classes when an object of one class is a data field within another class
optional classes
(Matching)
4.8/5
(40)

If you want all objects to share a single nonchanging value, then the field is static and ______.

(Multiple Choice)
4.8/5
(37)
Match each term with the correct statement below.
Premises:
An inner block is completely contained within an outer block
Responses:
enumeration
scope level
overloading
Correct Answer:
Verified
Premises:
Responses:
An inner block is completely contained within an outer block
enumeration
(Matching)
4.8/5
(36)
Match each term with the correct statement below.
Premises:
No object associated with them
Responses:
Math class
constant
shadowing
Correct Answer:
Verified
Premises:
Responses:
No object associated with them
Math class
(Matching)
4.9/5
(30)

____ are local classes that have no identifier.

(Multiple Choice)
4.8/5
(42)

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.

(Essay)
4.8/5
(39)

Describe how a Java variable comes into and out of scope.

(Essay)
4.9/5
(33)

You can use ____ arguments to initialize field values, but you can also use arguments for any other purpose.

(Multiple Choice)
4.8/5
(29)
Showing 41 - 60 of 84
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)