Definir como matriz
- Chame o método estático toArray ()
Object[] objects = collection3.toArray();
for (int i = 0; i < objects.length; i++) {
System.out.println(objects[i]);
}
Array torna-se coleção
- Chame o método estático asList () da classe Arrays
List strings = Arrays.asList(new String[]{
"AA", "BB", "CC"});