Exam 8: A Second Look at Classes and Objects

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

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

(Multiple Choice)
4.8/5
(36)

enum constants have a toString method.

(True/False)
4.9/5
(32)

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

(True/False)
4.9/5
(35)

The "has a" relationship is sometimes called a(n) __________ because one object is part of a greater whole.

(Multiple Choice)
4.8/5
(27)

A class that is defined inside another class is called a(n) __________.

(Multiple Choice)
4.8/5
(36)

Java automatically stores a __________ value in all uninitialized static member variables.

(Multiple Choice)
4.9/5
(35)

Given the following method header, what will be returned from the method? public Rectangle getRectangle()

(Multiple Choice)
4.8/5
(46)

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

(Multiple Choice)
4.8/5
(29)

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

(Multiple Choice)
4.9/5
(31)

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

You cannot use the == operator to compare the contents of __________.

(Multiple Choice)
4.8/5
(33)

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

(Multiple Choice)
4.8/5
(46)

Which of the following is not true about static methods?

(Multiple Choice)
4.9/5
(34)

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

When the this variable is used to call a constructor__________.

(Multiple Choice)
4.9/5
(35)

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

(True/False)
4.9/5
(37)

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

(Multiple Choice)
5.0/5
(36)

A static field is created by placing the key word static __________.

(Multiple Choice)
4.8/5
(31)

A declaration for an enumerated type begins with the __________ key word.

(Multiple Choice)
4.8/5
(44)

Given the following declaration: enum Tree ( OAK, MAPLE, PINE ) What is the ordinal value of the MAPLE enum constant?

(Multiple Choice)
4.9/5
(27)
Showing 21 - 40 of 52
close modal

Filters

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