Exam 9: A Second Look at Classes and Objects

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

When the this variable is used to call a constructor,

Free
(Multiple Choice)
4.9/5
(45)
Correct Answer:
Verified

A

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

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

True

The only limitation that static methods have is

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

D

When a field is declared static,there will be

(Multiple Choice)
4.9/5
(41)

Look at the following declaration. enum Tree { OAK,MAPLE,PINE } What is the fully-qualified name of the PINE enum constant?

(Multiple Choice)
4.7/5
(28)

CRC stands for

(Multiple Choice)
4.8/5
(37)

Which of the following is not true about static methods?

(Multiple Choice)
4.8/5
(34)

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

(True/False)
4.8/5
(37)

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

(True/False)
4.8/5
(31)

If you have defined a class SavingsAccount with a public static method getNumberOfAccounts(),and created a SavingsAccount object referenced by the variable account20,which of the following will call the getNumberOfAccounts()method?

(Multiple Choice)
4.8/5
(35)

If object1 and object2 are objects of the same class,to make object2 a copy of object1

(Multiple Choice)
4.9/5
(39)

If you write a toString method for a class,Java will automatically call the method any time you concatenate an object of the class with a string.

(True/False)
4.9/5
(32)

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

(Multiple Choice)
4.8/5
(47)

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

(True/False)
4.7/5
(44)

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

(Multiple Choice)
4.8/5
(32)

A declaration for an enumerated type begins with this key word.

(Multiple Choice)
5.0/5
(42)

The names of the enum constants in an enumerated data type must be enclosed in quotation marks.

(True/False)
4.9/5
(40)

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

(True/False)
4.9/5
(43)

If you have defined a class named SavingsAccount with a public static data member named numberOfAccounts,and created a SavingsAccount object referenced by the variable account20,which of the following will assign numberOfAccounts to numAccounts?

(Multiple Choice)
4.9/5
(40)

The whole-part relationship created by object aggregation is more often called

(Multiple Choice)
4.8/5
(40)
Showing 1 - 20 of 40
close modal

Filters

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