168k views
2 votes
Identify the association between MyCalendar and Day: public class MyCalendar{ enum Day{ FRIDAY,SATURDAY,SUNDAY,MONDAY,TUESDAY,WEDNESDAY,THURSDAY} } A) IS-A B) OWNS-A C) No association D) HAS-A

1 Answer

2 votes

Final answer:

The association between the MyCalendar class and the Day enum is the HAS-A association.

Step-by-step explanation:

The association between the MyCalendar class and the Day enum is the HAS-A association.

In object-oriented programming, the HAS-A association indicates that one class has a reference to another class as one of its members. In this case, the MyCalendar class has a reference to the Day enum, which is declared inside the MyCalendar class.

This association allows the MyCalendar class to use the values defined in the Day enum to represent different days of the week.

User Victor Pudeyev
by
8.0k points