String settings = "# test" + "/n" + "cource=java" + "/n" + "last_open_date = 2020-06-14"; ByteArrayInputStream input = new ByteArrayInputStream(settings.getBytes("UTF-8")); Properties props = new Properties(); props.load(input); System.out.println("course: " + props.getProperty("course")); System.out.println("last_open_date: " + props.getProperty("last_open_date")); System.out.println("last_open_file: " + props.getProperty("last_open_file")); System.out.println("auto_save: " + props.getProperty("auto_save", "60"));
我这样写的,为啥cource和last_open_date 打印出来都是null呢?
/n ----> \n
Sign in to make a reply
用户6266501526
我这样写的,为啥cource和last_open_date 打印出来都是null呢?