Demonstrating Usage of all Methods

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

public class Main {

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

    // Adding without index
    notPro.add("Akhil");
    notPro.add("Nakul");
    System.out.println("List 1 add() without index:" + "\n" + notPro + "\n");

    // list 1 adding with index
    notPro.add(0, "Nathan");
    notPro.add(2, "Rebecca");
    System.out.println("List 1 add() harsha at index 0, and nakul at index 2:" + "\n" + notPro + "\n");

    // size()
    System.out.println("Size of list 1:" + "\n" + notPro.size() + "\n");

    // Adding list 2 to list 1 using addAll()
    Pro.add("Federer");
    Pro.add("Nadal");
    Pro.add("Alcaraz");

    notPro.addAll(Pro);
    System.out.println("addAll() adding without index:" + "\n" + notPro + "\n");


    // Adding list 2 to list 1 with index
    notPro.clear();
    notPro.add("Akhil");
    notPro.add("Nakul");
    notPro.add(0, "Nathan");
    notPro.add(2, "Rebecca");

    notPro.addAll(2, Pro);
    System.out.println("addAll() adding at index 2:" + "\n" + notPro + "\n");

    // remove(int) index
    notPro.remove(6);
    System.out.println("remove() at index 6:" + "\n" + notPro + "\n");

    // remove(element)
    notPro.remove("Rebecca");
    System.out.println("remove() Rebecca:" + "\n" + notPro + "\n");

    // get(index)
    System.out.println("Get element at index 2:" + "\n" + notPro.get(2) + "\n");

    // set(index)
    System.out.print("Set element at index 2:" + "\n" + "Before: ");
    System.out.println(notPro);
    notPro.set(2, "Djokovic");
    System.out.println("After: " + notPro + "\n");

    // indexOf(element)
    System.out.println("indexOf Akhil:" + "\n" + notPro.indexOf("Akhil") + "\n");
    notPro.add("Akhil"); //temp for next method

    // lastIndexOf(element)
    System.out.println("Last index of Akhil: " + notPro.lastIndexOf("Akhil") + "\n" + notPro + "\n");

    // equals(element)
    System.out.println(" Equals Akhil: " + notPro.equals("Akhil") + "\n");

    // hascode()
    System.out.println("Hash Code: " + notPro.hashCode() + "\n");

    // isEmpty()
    System.out.println("Is the arraylist empty: "  + notPro.isEmpty() + "\n");

    // contains(element)
    System.out.println("Does arraylist contain 'Akhil': "  + notPro.contains("Akhil") + "\n");

    // containsAll(collection)

    System.out.println("Does arraylist contain Pro collection?: "  + "\n" + "Pro collection: " + Pro );
    System.out.println(notPro.containsAll(Pro) + "\n");
    
    notPro.add("Federer"); // Adding missing element

    System.out.println("Does arraylist contain Pro collection?: "  + "\n" + "New Pro collection: " + Pro );
    System.out.println(notPro.containsAll(Pro) + "\n");

    // sort(comparator)
    System.out.println("Unsorted: " + notPro);

    notPro.sort(Comparator.naturalOrder());
    System.out.println("Sorted using natural alphabetical order comparator: " + notPro + "\n");


    // clear()
    notPro.clear();
    Pro.clear();
    System.out.println("Cleared list1:" + "\n" + notPro);
    System.out.println("Cleared list2:" + "\n" + Pro);
    

  }

}

Main.main(null);
List 1 add() without index:
[Akhil, Nakul]

List 1 add() harsha at index 0, and nakul at index 2:
[Nathan, Akhil, Rebecca, Nakul]

Size of list 1:
4

addAll() adding without index:
[Nathan, Akhil, Rebecca, Nakul, Federer, Nadal, Alcaraz]

addAll() adding at index 2:
[Nathan, Akhil, Federer, Nadal, Alcaraz, Rebecca, Nakul]

remove() at index 6:
[Nathan, Akhil, Federer, Nadal, Alcaraz, Rebecca]

remove() Rebecca:
[Nathan, Akhil, Federer, Nadal, Alcaraz]

Get element at index 2:
Federer

Set element at index 2:
Before: [Nathan, Akhil, Federer, Nadal, Alcaraz]
After: [Nathan, Akhil, Djokovic, Nadal, Alcaraz]

indexOf Akhil:
1

Last index of Akhil: 5
[Nathan, Akhil, Djokovic, Nadal, Alcaraz, Akhil]

 Equals Akhil: false

Hash Code: -419671130

Is the arraylist empty: false

Does arraylist contain 'Akhil': true

Does arraylist contain Pro collection?: 
Pro collection: [Federer, Nadal, Alcaraz]
false

Does arraylist contain Pro collection?: 
New Pro collection: [Federer, Nadal, Alcaraz]
true

Unsorted: [Nathan, Akhil, Djokovic, Nadal, Alcaraz, Akhil, Federer]
Sorted using natural alphabetical order comparator: [Akhil, Akhil, Alcaraz, Djokovic, Federer, Nadal, Nathan]

Cleared list1:
[]
Cleared list2:
[]

Trying 2D Arrays to hold Student Information

import java.util.ArrayList;
import java.util.List;
 
public class Java2DArrayList {
 
    public static void main(String[] args) {
    
    ArrayList<List> arraylist2D = new ArrayList<List>();
    
    List student1=new ArrayList();
    student1.add("Akhil");
    student1.add("Period 2");
    student1.add("Mortensen");
    
    List student2=new ArrayList();
    student2.add("Re'em");
    student2.add("Period 2");
    student2.add("Mortensen");

    List student3=new ArrayList();
    student3.add("Saathvika");
    student3.add("Period 2");
    student3.add("Mortensen");

    List student4=new ArrayList();
    student4.add("Tristan");
    student4.add("Period 2");
    student4.add("Mortensen");
    
    arraylist2D.add(student1);
    arraylist2D.add(student2);
    arraylist2D.add(student3);
    
    System.out.println(arraylist2D);
    }
}

Java2DArrayList.main(null);
[[Akhil, Period 2, Mortensen], [Re'em, Period 2, Mortensen], [Saathvika, Period 2, Mortensen]]