import java.util.*;

public class ArrayListIntro
{
	public static void main( String [] args )
	{
		ArrayList myList = new ArrayList();
		String mySThjkhjkhklj = new String();
		
		//add the first 100 integers to the list
		for (int i = 0; i < 100; i++)
		{
			String x = "hello-" + i;
			myList.add(x);
		}
		
		//remove all the elements in the list
		//myList.clear();
		
		//print out the list
		for (int i = 0; i < myList.size(); i++)
		{
			//get() returns a list element at a particular index
			System.out.println( myList.get(i) );
		}
		
		//check if the list is empty
		if (myList.isEmpty())
		{
			System.out.println( "THE LIST IS EMPTY!" );
		}
		else
		{
			System.out.println( "THE LIST IS NOT EMPTY!" );
		}
		
		//remove every other element in the list
		int size = myList.size();
		for (int i = size-1; i >= 0; i--)
		{
			if (i % 2 == 0)
			{
				myList.remove(i);
			}
		}
		
		//print out the list
		for (int i = 0; i < myList.size(); i++)
		{
			//get() returns a list element at a particular index
			System.out.println( myList.get(i) );
		}
	}
}