title: Creating a student arraylist to add students to course class Java
body: <p>Im trying to create a student arraylist to a a course class so that when a student is added the arraylist is increases. this is the code I have so far:</p>
  
  <pre><code>import java.util.ArrayList;
  
  /*
   * To change this license header, choose License Headers in Project Properties.
   * To change this template file, choose Tools | Templates
   * and open the template in the editor.
   */
  
  /**
   *
   * @author Saj
   */
  public class Course {
      private String courseName;
      private int noOfStudents;
      private String teacher;
      public static int instances = 0;
  
      //Getters
      public String getCourseName(){
          return this.courseName;
      }
      public int getNoOfStudents(){
          return this.noOfStudents;
      }
      public String getTeacher(){
          return this.teacher;
      }
  
      //Setters
      public void setCourseName(String courseName){
          this.courseName = courseName;
      }
      public void setNoOfStudents(int noOfStudents){
          this.noOfStudents = noOfStudents;
      }
      public void setTeacher(String teacher){
          this.teacher = teacher;
      }
  
      /**
       * Default constructor. Populates course name, number of students with defaults
       */
      public Course(){
          instances++;
          this.noOfStudents = 0;
          this.courseName = "Not Set";
          this.teacher = "Not Set";
      }
  
      /** 
       * Constructor with parameters 
       * @param noOfStudents integer
       * @param courseName String with the Course name
       * @param teacher String with the teacher
      */
      public Course(int noOfStudents, String courseName, String teacher){
          this.noOfStudents = noOfStudents;
          this.courseName = courseName;
          this.teacher = teacher;
      }
  
  }
  </code></pre>
  
  <p>Im unsure how to implement the array list. Can someone point me in the right direction.</p>