Use of List in java by jayesh powered by(view source)

Description import java.util.*; public class Hello { public static void main(String[] args) { System.out.println("Hi,Aurthor:jayesh barot"); List<String> myList = new ArrayList<String>(); ArrayList<String> my = new ArrayList<String>();
Input
Parameter Value Description
myList.add("1"); myList.add("2"); myList.add("3"); myList.add("4"); my.add("4"); System.out.println( myList.size() + ", and " + "the first is " + myList);
for (int len = myList.size(), i = 0; i < len; i++) { String s = myList.get(i); System.out.println("Item " + i + " is " + s); } for (String ss : my) { System.out.println("Next item: " + ss); } } }
Output