Question:
Given the following BlueJ class diagram
Lecturer class (same with previous lab, no changes needed)
Student class (same with previous lab, no changes needed)
LectureRoom (changes occurs here)
1. LectureRoom has roomNumber (e.g. A301), courseName (e.g.
Java), lecturer (a reference to a Lecturer object), and studentList (a reference to an ArrayList that stores Student object).
2. LectureRoom has a constructor that receives courseName, roomNumber, and Lecturer. The constructor then sets/assign the courseName, roomNumber and Lecturer.
This constructor also creates the studentList arraylist object.
I am fairly new to Java programming and I think I got Question 1 Correct.
It is the second question that really made my grey hair blossom. I did my search first but I can't seem to find any similar question.
Could anyone kindly explain to me? Samples would be greatly appreciated!
Sam