Asmt 2
Asmt 2
Fields:
String name
int age
Methods:
Fields:
String studentId
ArrayList<Course> enrolledCourses → Stores enrolled courses.
Methods:
✅ void displayEnrolledCourses()
✅ Override displayInfo()
Fields:
String instructorId
ArrayList<Course> assignedCourses → Stores courses the instructor teaches.
Methods:
✅ void assignCourse(Course course)
✅ void displayAssignedCourses()
✅ Override displayInfo()
4. Class: Course
Fields:
String courseId
String courseName
Instructor instructor (assigned instructor, can be null)
Methods:
✅ void displayCourseInfo()
Student Info:
Name: Alice
Age: 20
Instructor Info:
Age: 45