import java.util.ArrayList;
import java.util.Comparator;

public class ArrayListQuiz {

  public static void main(String[] args) {
   
    // Creating 2 arraylists
    ArrayList<String> Quiz = new ArrayList<String>();
    // ArrayList<String> footballPlayers = new ArrayList<String>();

    // Adding without index
    Quiz.add("What is the chemical symbol for gold?");
    Quiz.add("What is the 5th planet from the sun?");
    Quiz.add("What is the acceleration of gravity?");
    System.out.println(Quiz);

    // Adding players with index
    Quiz.add(0, "What is the chemical symbol for helium?");
    Quiz.add(1, "What is the 8th planet from the sun?");
    System.out.println("setting the questions at certain indexes: " + "\n" + Quiz + "\n");

    // Showing size of list
    System.out.println("Size of array list: " + "\n" + Quiz.size() + "\n");

    // Remove item with index
    Quiz.remove(2);
    System.out.println("removing the third question at index 2: " + "\n" + Quiz + "\n");

    // Remove an item
    Quiz.remove("What is the chemical symbol for helium?");
    System.out.println("removing the helium question: " + "\n" + Quiz + "\n");
    Quiz.add("What is the 8th planet from the sun?");

    // get an iteam with index
    System.out.println("Get element at index 1: " + "\n" + Quiz.get(1) + "\n");

    // find index of an item
    System.out.println("indexing the helium question: " + "\n" + Quiz.indexOf("What is the chemical symbol for helium?") + "\n");
    
    // hashcode of list
    System.out.println("Hash Code: " + Quiz.hashCode() + "\n");

    // check if list is empty
    System.out.println("Is the arraylist empty: "  + Quiz.isEmpty() + "\n");

    // check if list contains an item
    System.out.println("Does arraylist contain What is the 8th planet from the sun?"  + Quiz.contains("What is the 8th planet from the sun?") + "\n");

    // clears list
    Quiz.clear();
    System.out.println("Cleared arrayList:" + "\n" + Quiz);
  }

}

ArrayListQuiz.main(null);
[What is the chemical symbol for gold?, What is the 5th planet from the sun?, What is the acceleration of gravity?]
setting the questions at certain indexes: 
[What is the chemical symbol for helium?, What is the 8th planet from the sun?, What is the chemical symbol for gold?, What is the 5th planet from the sun?, What is the acceleration of gravity?]

Size of array list: 
5

removing the third question at index 2: 
[What is the chemical symbol for helium?, What is the 8th planet from the sun?, What is the 5th planet from the sun?, What is the acceleration of gravity?]

removing the helium question: 
[What is the 8th planet from the sun?, What is the 5th planet from the sun?, What is the acceleration of gravity?]

Get element at index 1: 
What is the 5th planet from the sun?

indexing the helium question: 
-1

Hash Code: -966479922

Is the arraylist empty: false

Does arraylist contain What is the 8th planet from the sun?true

Cleared arrayList:
[]