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