之前每次都是通过循环去写,感觉代码不够优雅,百度了一下,查到如下的写法,先记下来: List<Long> list = new ArrayList<Long>(); list.add(1L); list.add(2L); list.add(3L); System.out.println(list); long [] array = list.stream().mapToLong(t->t.longValue()).toArray();
JAVA的list,set,数组之间的转换,主要是使用Apache Jakarta Commons Collections,具体的方法如下:import org.apache.commons.collections.CollectionUtils; String[] strArray = {"aaa", "bbb", "ccc"}; List strList = new ArrayList(); Set strSet = new Ha
java.sql.SQLException之数组越界 1.具体错误如下: (1)java.sql.SQLException:Parameter index out of range(0<1) (2)java.sql.SQLException:Parameter index out of range(23>number of parameters,which is 22) 2.错误原因 在SQL语句传参的个数和接受的参数个数不一致,导致出错