Class Course

java.lang.Object
com.project.system.Course

public class Course extends Object
The Course class represents a course in the Student-Course Registration System. It contains the course name, description, and a list of enrolled students.
  • Field Details

    • NAME

      private final String NAME
      The name of the course (final and immutable).
    • description

      private String description
      A brief description of the course.
    • enrolledStudents

      private List<String> enrolledStudents
      A list of students enrolled in the course.
  • Constructor Details

    • Course

      public Course(String NAME, String description)
      Constructs a new Course instance with a name and description. Initializes an empty list of enrolled students.
      Parameters:
      NAME - The name of the course.
      description - The description of the course.
  • Method Details

    • getName

      protected String getName()
      Gets the name of the course.
      Returns:
      The name of the course.
    • getDescription

      protected String getDescription()
      Gets the description of the course.
      Returns:
      The course description.
    • setDescription

      protected void setDescription(String description)
      Sets the description of the course.
      Parameters:
      description - The new description to set.
    • getEnrolledStudents

      protected List<String> getEnrolledStudents()
      Gets the list of students enrolled in the course.
      Returns:
      A list of enrolled students.
    • enrollStudent

      protected void enrollStudent(String studentName)
      Enrolls a new student into the course.
      Parameters:
      studentName - The name of the student to enroll.
    • setEnrolledStudents

      protected void setEnrolledStudents(List<String> students)
      Sets the list of enrolled students for the course.
      Parameters:
      students - The list of students to be set.