Os:windows7 x64
Jdk:jdk-8u131-windows-x64
Ide:eclipse Oxygen Release (4.7.0)
Information:
The case of the Javase8 folder when writing code.
Code
Package Jizuiku0;import java.io.file;import java.io.ioexception;/* * @version V17.09 */public class Filedemo_1 {public St atic void Main (string[] args) {//Demo folder is not present in String pathname = "c:\\users\\administrator\\desktop\\javase8\\demo\\1. TXT "; File File = new file (pathname), try {if (File.createnewfile ()) {System.out.println ("All levels of folders exist, files are created successfully");}} catch ( IOException e) {//TODO auto-generated catch Blocke.printstacktrace (); System.out.println ("The folder where the file is saved does not exist, please create the folder First");}}
Result
Java is good, worth learning.
Learning resources: Itcast and Itheima Video library. If you have public resources, can share to me, with your resources to learn also can.
Blog post is to watch the video, into thinking written. It's good that the teacher speaks well. Blog bad, is to give the most bitter not serious.
JavaSE8 base file CreateNewFile throws an IO exception when creating files in a nonexistent folder (absolute path)