asked on
package StudentClass;
import java.util.*;
public class StudentRecords{
public static void main(String[] args) {
ArrayList<String/*, String, String*/> StudRecord = new ArrayList<String/*, String, String*/>();
StudRecord.add("Will"/*, "reading", "A"*/);
/*obj.add("Harry");
obj.add("Chaitanya");
obj.add("Steve");
obj.add("Anuj");*/
//System.out.println("Currently the array list has following elements:"+obj);
/*Add element at the given index*/
//obj.add(0, "Rahul");
StudRecord.add("Justin"/*, reading, "B"*/);
/*Remove elements from array list like this*/
//obj.remove("Chaitanya");
// obj.remove("Harry");
System.out.println("Current array list is:"+StudRecord);
/*Remove element from the given index*/
// obj.remove(1);
System.out.println("Current array list is:"+StudRecord);
}
}