Exam 5: Defining Classes II

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

The String class is a mutable class.

Free
(True/False)
4.8/5
(35)
Correct Answer:
Verified

False

Converting from a value of primitive type to a corresponding object of its associated wrapper class is called:

Free
(Multiple Choice)
4.8/5
(43)
Correct Answer:
Verified

A

What is the purpose of Java's wrapper classes?

Free
(Essay)
4.8/5
(32)
Correct Answer:
Verified

The wrapper classes contain a number of useful constants and static methods.Wrapper classes accomplish two tasks: they produce class objects corresponding to values of primitive types,and they supply useful constants and methods.

An example of secondary memory is:

(Multiple Choice)
4.8/5
(40)

The method trim of the String class trims off:

(Multiple Choice)
5.0/5
(39)

A main method can be placed inside a class definition.

(True/False)
5.0/5
(42)

Does an object created with a copy constructor reference the same memory location that the original object references? Explain.

(Essay)
4.8/5
(32)

Write a statement that creates and initializes a static variable named salesTax to 7.59.

(Essay)
4.8/5
(40)

Write a statement that creates a constant variable named TAX_RATE.The tax rate is 8.25%.

(Essay)
4.9/5
(33)

A class invariant is a statement that is always true for every object of the class.

(True/False)
4.8/5
(35)

All of these are methods of Java's Math class except:

(Multiple Choice)
4.8/5
(42)

To use a package,the program must contain an import statement that names the package.

(True/False)
4.8/5
(32)

Add accessor and mutator methods to the Book class created in question #13.

(Essay)
4.8/5
(33)

To create a package,you must add a package statement at the ____________ of each class file.

(Multiple Choice)
4.8/5
(36)

Define boxing and unboxing.

(Essay)
4.8/5
(36)

Explain in detail how main memory works.

(Essay)
4.9/5
(32)

Static variables are often used:

(Multiple Choice)
4.7/5
(41)

Explain how a package is named in Java.

(Essay)
4.8/5
(37)

Wrapper classes provide a class type corresponding to each of the primitive types so that you can have class types that behave somewhat like primitive types.

(True/False)
4.9/5
(35)

When you use the assignment operator with variables of a class type,you are assigning a:

(Multiple Choice)
4.7/5
(34)
Showing 1 - 20 of 46
close modal

Filters

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