ArrayList Some Important Point in java :-
# Java Array-List class can contain duplicate elements.
# Java Array-List class maintains insertion order Java.
# Array-List class is non synchronized.
# Java Array-List allows random access because array works at the index basis.
# In Java Array-List class, manipulation is slow because a lot of shifting needs to be occurred if any element is removed from the array list.
ArrayList Example....
import java.util.*;
class Examplecolection{
public static void main(String args[]){
ArrayList<String> list=new ArrayList<String>();
list.add("Raj");
list.add("Vinay");
list.add("Rai");
list.add("Jay");
for(String obj:list)
System.out.println(obj);
}
}
No comments:
Post a Comment