import java.util.ArrayList;
public class ReplaceElementInArrayList
{
public static void main(String args[])
{
ArrayList arrList=new ArrayList();
arrList.add("Harit");
arrList.add("Lalit");
for(Object list:arrList)
{
System.out.println(list);
}
arrList.set(0,"Nikki");
for(Object list:arrList)
{
System.out.println(list);
}
}
}
public class ReplaceElementInArrayList
{
public static void main(String args[])
{
ArrayList arrList=new ArrayList();
arrList.add("Harit");
arrList.add("Lalit");
for(Object list:arrList)
{
System.out.println(list);
}
arrList.set(0,"Nikki");
for(Object list:arrList)
{
System.out.println(list);
}
}
}
0 comments:
Post a Comment