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

enum constants have a toString method.

(True/False)
4.9/5
(83)

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

(True/False)
4.9/5
(67)

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

(Multiple Choice)
4.9/5
(63)

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

(Multiple Choice)
4.8/5
(80)

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

(Multiple Choice)
4.9/5
(83)

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

(Multiple Choice)
4.9/5
(90)

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

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

(Multiple Choice)
5.0/5
(76)

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

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

(Multiple Choice)
4.9/5
(77)

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

(Multiple Choice)
4.8/5
(89)

Which of the following is not true about static methods?

(Multiple Choice)
4.9/5
(69)

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

When the this variable is used to call a constructor__________.

(Multiple Choice)
4.9/5
(74)

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

(True/False)
4.9/5
(81)

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

(Multiple Choice)
5.0/5
(69)

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

(Multiple Choice)
4.8/5
(68)

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

(Multiple Choice)
4.8/5
(91)

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

(Multiple Choice)
5.0/5
(67)
Showing 21 - 40 of 52
close modal

Filters

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