Exam 6: A Second Look at Classes and Objects

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

A method's signature consists of

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

A

Of the following, which would be considered the no-arg constructor for the Rectangle class?

Free
(Multiple Choice)
4.7/5
(44)
Correct Answer:
Verified

C

When you make a copy of the aggregate object and of the objects it references,

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

C

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

(Multiple Choice)
4.8/5
(40)

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

(Multiple Choice)
4.8/5
(40)

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

(True/False)
4.8/5
(28)

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

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)

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

(Multiple Choice)
4.9/5
(44)

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

(Multiple Choice)
4.9/5
(33)

When a method in the ________ class returns a reference to a field object, it should return a reference to a copy of the field object to prevent "security holes."

(Multiple Choice)
4.7/5
(38)

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

The only limitation that static methods have is

(Multiple Choice)
4.8/5
(43)

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

(Multiple Choice)
4.9/5
(37)

You can use the enum key word to

(Multiple Choice)
4.8/5
(36)

enum constants have a toString method.

(True/False)
4.8/5
(31)

________ is the term for the relationship created by object aggregation.

(Multiple Choice)
4.9/5
(48)

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

(Multiple Choice)
4.7/5
(38)

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

(Multiple Choice)
4.9/5
(41)

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

(True/False)
4.8/5
(39)
Showing 1 - 20 of 40
close modal

Filters

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