mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-03 19:58:23 +07:00
18 lines
409 B
Java
18 lines
409 B
Java
// "Replace with toArray" "true"
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
public class Main {
|
|
public Object[] testToArray(List<String> data) {
|
|
Object[] arr;
|
|
List<String> result = new ArrayList<>();
|
|
for (String str : d<caret>ata) {
|
|
if (!str.isEmpty())
|
|
result.add(str);
|
|
}
|
|
arr = result.toArray();
|
|
System.out.println(Arrays.toString(arr));
|
|
return arr;
|
|
}
|
|
} |