忆安 千里之行始于足下、记录下的点滴,必将汇成浩瀚的海洋

随笔分类 -  Java

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