①创建数组的方式3种 ①第1种方法 public class MyTest { public static void main(String[] args){ //method 1 int[] array=new int[6]; int aa=array[4]; System.out.print(aa); } } output:0 ②第2种方法 public class MyTest { public static void main(String[] args){ //method 2 int…
今天在做项目过程中,查询一个表中数据时总碰到这个问题: java.sql.SQLException:Value '0000-00-00' can not be represented as java.sql.Date 查看数据库,发现某一字段为date类型,字段值为'0000-00-00' ;查看代码,我用的是rs.getString("字段名");于是把代码改成getDate("字段名");问题依旧! 查找资料发现:在数据库连接url后面加上ze…
String fdbs = "WXB,WXA,FDA,WXB"; String[] str = fdbs.split(","); Set set = new HashSet(); for (int i = 0; i < str.length; i++) { set.add(str[i]); } str = (String[]) set.toArray(new String[0]); for (int i = 0; i < str.length; i++)…