随笔分类 - Java
摘要:int hyear = Integer.valueOf(calendarPo.getC_year()); int hmonth = Integer.valueOf(calendarPo.getC_month())-1; //月份从0开始 Calendar calendar = new Gregori
阅读全文
摘要:SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式 System.out.println(df.format(new Date()));// new Date()为获取当前系统时间
阅读全文
摘要:一、try-catch的使用 需要捕获的异常.,如果不知道需捕获什么异常那么直接捕获最大的异常就行了, Exception e try{ (需要捕获的代码,此代码发生异常时进入catch) }catch( Exception e){ e.printStackTrace();//异常信息的输出 } 二
阅读全文
摘要:public static boolean isChinese(String str) { Pattern p = Pattern.compile("[\u4e00-\u9fa5]"); Matcher m = p.matcher(str); if (m.find()) { return true;
阅读全文

浙公网安备 33010602011771号