You are on page 1of 1

arrays in java has fixed size and cannot be expanded.

A collection can store a heterogeneous values. Default will be object type or we


can define collecction type by generics. Collection doesnt work with index
numbers.Thus we will use LIST instead.
List<Integer> col= new ArrayList<>(); index number is valid.
we can add as many as values.
in tree set output data same as input?
for( object z: col)
system.out.print(z)
Collections.sort(col); //read it
list is based on indexing number unlike set,hash.
9330523066 amit kumar rai
akraja09@outlook.com email

You might also like