Java Collection and Iterator program

Recently just create a simple Java program which involves collection and iterator object and would like to share with you as follow.

package com.codingdirectional.www;

import java.util.ArrayList;
import java.util.Iterator;

public class CollectionDemo {

	public static void main(String[] args) {
		ArrayList<String> hello = new ArrayList<String>();
		hello.add("hello");
		hello.add("world");
		
		for (int i = 0; i < hello.size(); i++) {
		    String word = hello.get(i);
		    System.out.println(word);
		}
		
		hello.remove(0);
		
		for (int i = 0; i < hello.size(); i++) {
		    String word = hello.get(i);
		    System.out.println(word);
		}
		
		ArrayList<String> hi = new ArrayList<String>();
		hi.add("hello");
		hi.add("world");
		
		hi.removeAll(hello);
		
		for (int i = 0; i < hi.size(); i++) {
		    String word = hi.get(i);
		    System.out.println(word);
		}
		
		Iterator<String> hi_ = hi.iterator();
		while(hi_.hasNext())
			System.out.println(hi_.next());

	}

}

The outcome is as follows :

hello
world
world
hello
hello