What is an Array List?

An array list is basically an array that you can change the size of. This is unlike normal arrays, as they have their size set from the start and you cannot change the preassigned size of that array.

Application to Science Olympiad Website

Since we are making a Science Olympiad Website anyways, it would be great to get some of it started here so that we can get a bit of a head start on some of the things that we need to do to make this a fully functioning website.

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Member{
    String firstname;
    String lastname;
    String role;
    int grade;
    String email;

    public Member(String firstname, String lastname, String role, int grade, String email){
        this.firstname = firstname;
        this.lastname = lastname;
        this.role = role;
        this.grade = grade;
        this.email = email;
    }

    public String toString() {
        return String.format("%s\t%s\t%s\t%d\t%s", firstname, lastname, role, grade, email);
    }

    public static void main(String[] args){
        List<Member> listMembers = new ArrayList<Member>();

        listMembers.add(new Member("Krish", "Patil", "Leadership", 11, "krishpatil1019@gmail.com"));
        listMembers.add(new Member("Don", "Tran", "Leadership", 11, "donqt@gmail.com"));
        listMembers.add(new Member("Rohan", "Gaikwad", "Vice President", 11, "gaikwadrohan326@gmail.com"));
        listMembers.add(new Member("Audrey", "Zeng", "President", 12, "audreyhuaxia@gmail.com "));
        

        for (Member n : listMembers){
            System.out.println(n);
        }
    }
}

Member.main(null);
Krish	Patil	Leadership	11	krishpatil1019@gmail.com
Don	Tran	Leadership	11	donqt@gmail.com
Rohan	Gaikwad	Vice President	11	gaikwadrohan326@gmail.com
Audrey	Zeng	President	12	audreyhuaxia@gmail.com 

Here we can see some of our members along with their roles, grade, and email!