Simple ArrayList Example in Java

package com.javatraineronline;

import java.util.ArrayList;
import java.util.List;

public class SimpleArrayList {

	public static void main(String[] args) {
				
		List<String> list = new ArrayList<String>();
		list.add("One");
		list.add("Two");
		list.add("Three");
		list.add("Four");
		list.add("Five");
		
		System.out.println("List : "+list);
	}
}

[su_box title=”Output for SimpleArrayList.java”]List : [One, Two, Three, Four, Five][/su_box]