免费创建手机网站,上海网站设计建设,宿迁房产网丫丫,电商设计需要学什么java获取当前路径的几种方法 1、利用System.getProperty()函数获取当前路径#xff1a; System.out.println(System.getProperty(user.dir));//user.dir指定了当前的路径 2、使用File提供的函数获取当前路径#xff1a; File directory new File( System.out.println(System.getProperty(user.dir));//user.dir指定了当前的路径 2、使用File提供的函数获取当前路径 File directory new File();//设定为当前文件夹获取当前时间的前三个月Date date new Date();SimpleDateFormat sdf new SimpleDateFormat(yyyy-MM-dd);String time sdf.format(date);String[] item time.split(-);int year Integer.parseInt(item[0]);int month Integer.parseInt(item[1]);int day Integer.parseInt(item[2]);if((month - 3) 0){month month 12 - 3;year year -1;}else {month month - 3;}time year - month - day;