You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rule 12. 【推荐】Array 与 List互转的正确写法
两种Array转换List,错误和正确的代码范例: // array -> list List list = Arrays.asList(array); //WRONG List list = new ArrayList(array); //RIGHT
其中正确的方式:List list = new ArrayList(array)
ArrayList的构造函数有三种:无参数、一个参数:容量、一个参数:Collection<? extends E>
没有可供直接传数组的构造方法
The text was updated successfully, but these errors were encountered:
Rule 12. 【推荐】Array 与 List互转的正确写法
两种Array转换List,错误和正确的代码范例:
// array -> list List list = Arrays.asList(array); //WRONG List list = new ArrayList(array); //RIGHT
其中正确的方式:List list = new ArrayList(array)
ArrayList的构造函数有三种:无参数、一个参数:容量、一个参数:Collection<? extends E>
没有可供直接传数组的构造方法
The text was updated successfully, but these errors were encountered: