Exam 6: A Second Look at Classes and Objects

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

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

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

(Multiple Choice)
4.9/5
(68)

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

(Multiple Choice)
4.9/5
(81)

You can use the enum key word to

(Multiple Choice)
4.9/5
(77)

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

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

(Multiple Choice)
4.8/5
(86)

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

(True/False)
4.8/5
(81)

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

(Multiple Choice)
4.8/5
(88)

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

(Multiple Choice)
4.8/5
(81)

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

(Multiple Choice)
4.7/5
(73)

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

(Multiple Choice)
4.9/5
(84)

The only limitation that static methods have is

(Multiple Choice)
4.9/5
(77)

Overloading is

(Multiple Choice)
4.8/5
(79)

enum constants have a toString method.

(True/False)
4.8/5
(79)

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

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

(Multiple Choice)
4.9/5
(70)

Assume the class BankAccount has been created and the following statement correctly creates an instance of the class. BankAccount account = new BankAccount(5000.00); What is true about the following statement? System.out.println(account);

(Multiple Choice)
4.9/5
(71)

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

(Multiple Choice)
4.7/5
(68)

You can declare an enumerated data type inside a method.

(True/False)
4.9/5
(75)

A method's signature consists of

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

Filters

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