Example:
import java.util.*;
class demo
{
public static void main(String[] args){
ArrayList
al.add("abcd");
al.add("kjhh");
al.add("kkhf");
al.add("cdfbg");
al.add("actfd");
int i=1;
for (String x:al)
{
System.out.print("The "+i+++" element is:");
System.out.println(x);}
}};
No comments:
Post a Comment