Exam 9: A Second Look at Classes and Objects

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

If a class has a method named finalize,it is called automatically just before an instance of the class is destroyed by the garbage collector.

(True/False)
5.0/5
(43)

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
(38)

When a method's return type is a class,what is actually returned to the calling program?

(Multiple Choice)
4.8/5
(37)

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.7/5
(34)

Enum constants have a toString method.

(True/False)
4.8/5
(30)

A static field is created by placing

(Multiple Choice)
4.8/5
(38)

The JVM periodically performs this process to remove unreferenced objects from memory.

(Multiple Choice)
4.8/5
(43)

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.8/5
(31)

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.8/5
(30)

Look at the following declaration. enum Tree { OAK,MAPLE,PINE } What is the ordinal value of the MAPLE enum constant?

(Multiple Choice)
4.8/5
(31)

If you write a toString method to display the contents of an object,object1,for a class,Class1,then the following two statements are equivalent: System.out.println(object1); System.out.println(object1.toString());

(True/False)
4.9/5
(39)

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.7/5
(32)

A class's static methods do not operate on the fields that belong to any instance of the class.

(True/False)
4.8/5
(37)

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
(38)

Enumerated types have this method,which returns the position of an enum constant in the declaration list.

(Multiple Choice)
4.9/5
(34)

The term for the relationship created by object aggregation is

(Multiple Choice)
4.7/5
(31)

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

(True/False)
4.8/5
(37)

Which of the following is not true about static methods?

(Multiple Choice)
4.7/5
(40)

A deep copy of an object

(Multiple Choice)
4.9/5
(37)

If the this variable is used to call a constructor,

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

Filters

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