Exam 8: A Second Look at Classes and Objects

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

You cannot use the == operator to compare the contents of:

(Multiple Choice)
4.8/5
(34)

An instance of a class does not have to exist in order for values to be stored in a class's static fields.

(True/False)
4.8/5
(36)

The only limitation that static methods have is:

(Multiple Choice)
4.8/5
(31)

When an object is passed as an argument, it is actually a reference to the object that is passed.

(True/False)
4.9/5
(44)

An enumerated data type is actually a special type of class.

(True/False)
4.9/5
(38)

You can declare an enumerated data type inside of a method.

(True/False)
4.9/5
(37)

The key word this is the name of a reference variable that an object can use to refer to itself.

(True/False)
4.9/5
(35)

You cannot use the fully-qualified name of an enum constant for this.

(Multiple Choice)
4.8/5
(36)

A deep copy of an object:

(Multiple Choice)
4.8/5
(43)

The term for the relationship created by object aggregation is:

(Multiple Choice)
4.8/5
(41)

If the following is from the method section of a UML diagram, which of the following statements is TRUE? + add(object2:Stock): Stock

(Multiple Choice)
4.9/5
(43)

Both instance fields and instance methods are associated with a specific instance of a class, and they cannot be used until an instance of the class is created.

(True/False)
4.7/5
(33)

If the following is from the method section of a UML diagram, which of the following statements is TRUE? + equals(object2:Stock) : boolean

(Multiple Choice)
4.7/5
(34)

If you attempt to perform an operation with a null reference variable:

(Multiple Choice)
4.7/5
(32)

When an object reference is passed to a method, the method may change the values in the object.

(True/False)
4.8/5
(46)

Assuming the following declaration exists: enum Tree { OAK, MAPLE, PINE } What will the following code display? System.out.println(Tree.OAK);

(Multiple Choice)
4.8/5
(37)

What will be returned from a method, if the following is the method header? Public Rectangle getRectangle()

(Multiple Choice)
4.8/5
(39)

If a class has a method named finalize, it is called automatically just before a data member that has been identified as final of the class is destroyed by the garbage collector.

(True/False)
4.9/5
(41)

The this key word is the name of a reference variable that is available to all static methods.

(True/False)
4.9/5
(35)

Assume the class BankAccount has been created, and the following statement correctly creates an instance of the class: BankAccount account = new BankAccount(5000.0); What is TRUE about the following statement? System.out.println(account);

(Multiple Choice)
4.8/5
(34)
Showing 21 - 40 of 50
close modal

Filters

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