I have an array of object like
A[] a;
I also have a list of A like List<A> b = new ArrayList<A>();
I am wondering how to add a to b?
Just use the addAll() method with Arrays.asList() as argument:
b.addAll(Arrays.asList(a));
Iterate the array and add each element
for( A element : a ) {
b.add( element )
}
Assuming you are adding the contents of a to b, you would want to use Collections.addAll(b, a);
atob, or do you want to add the array itself tob?