mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-20 20:20:56 +07:00
19 lines
486 B
Java
19 lines
486 B
Java
// "Introduce new StringBuilder to update variable 'res' (null-safe)" "true-preview"
|
|
public class SB {
|
|
public static void main(String[] args) {
|
|
StringBuilder resBuilder = null;
|
|
for (String arg : args) {
|
|
if (resBuilder == null) {
|
|
resBuilder = new StringBuilder("[");
|
|
} else {
|
|
resBuilder.append(",");
|
|
}
|
|
resBuilder.append(arg);
|
|
}
|
|
String res = String.valueOf(resBuilder);
|
|
res += "]";
|
|
System.out.println(res);
|
|
}
|
|
}
|
|
|