public class FoldPaper {
private ArrayList<String>res = new ArrayList<>();
public String[] foldPaper(int n) {
// write code here
printProcesses(1,n,true);
String []str= res.toArray(new String[]{});
return str;
}
问题:.toArray(new String[]{}) 小括号里面的参数是什么意思?
这个就是把容器里面的值转变为string数组
https://zhidao.baidu.com/question/581288767.html