Example:-Public Class MyClass
{
public static void main(string[] args)
{
int single_array=new int[5]; OR {1,2,3,4,5}
ArrayList<Integer>MyList=newArrayList<Integer>(5);
MyList.add(1);
MyList.add(5);
for(Integer x:MyList)
MyList.remove(2); //To remove index size
MyList.clear(); //to clear index size
System.out.println(x);
System.out.println(MyList.Size());
}
}
0 Comments:
Post a Comment