title: Simple Java program Arraylist
body: <p>I'm trying to make a simple program that demonstrates the use of ArrayLists of objects. I want to be able to input the details to be stored in the objects as well as searching for and printing objects.</p>
  
  <p>I'm doing it on Students I have my Student class made and I have started my studentTest class but I'm looking for help with input to start with. </p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>package student;
  
  public class Student {
  
      private String studentName;
      private String studentNo;
      private String email;
      private int year;
  
      public Student() {
        /**studentName = null;
          *studentNo = null;
          *email = null;
          *year = -1;
          */
      }
  
      public Student(String nName, String nNum, String nEmail, int nYr) {
          this.studentName = nName;
          this.studentNo = nNum;
          this.email = nEmail;
          this.year = nYr;
      }
  
      public void setStudentName(String newStudentName) {
          studentName = newStudentName;
      }
  
      public void setStudentNo(String newStudentNo) {
          studentNo = newStudentNo;
      }
  
      public void setEmail(String newEmail) {
          email = newEmail;
      }
  
      public void setYear(int newYear) {
          year = newYear;
      }
  
      public String getStudentName() {
          return studentName;
      }
  
      public String getStudentNo() {
          return studentNo;
      }
  
      public String getEmail() {
          return email;
      }
  
      public int getYear() {
          return year;
      }
  
  
      }
  }
  
  package student;
  import java.util.ArrayList;
  import java.util.Scanner;
  
  public class studentTest {
  
      public static void main(String[] args) {
  
          Scanner input = new Scanner(System.in);
  
          Student student1 = new Student();
          Student student2 = new Student();
          Student student3 = new Student();
          Student student4 = new Student();
          Student student5 = new Student();
  
  
      }
  }
  </code></pre>