User Defined Types  «Prev  Next»

Objects and Classes - Quiz

Each question is worth one point. Select the best answer or answers for each question.
 
1. Consider a class called Date that represents an individual date. Which of the following could be an object that is an instance of the Date class?
Please select the best answer.
  A. Wednesdays
  B. January 17, 2001
  C. January 2001
  D. January 17-21, 2001

2. Which of the following items in the diagram is an attribute of the class?
Please select the best answer.
  A. salary
  B. Money
  C. dollars
  D. 876

3. Consider this class diagram for a Date class:
Date
year: Integer
month: Integer
day: Integer

Which of the following is a correct object diagram for a Date object named Christmas set to December 25, 1999?
Please select the best answer.
  A.
date: Date
year: 1999
month: 12
day: 25
  B.
Christmas: Date
day: 25
month: 12
year: 1999

  C.
Christmas:Date
year: 1999
month: December
day: 25

  D.
Date
year: 1999
month: December
day: 25


Correct answers:

Your Score: 0