public static void main(String[] args) {
File newTxt = new File("C:/Users/cauan/Desktop/newTxt.txt");
if(newTxt.exists()) System.out.println("The file already exists!");
else {
try{
newTxt.createNewFile();
FileWriter fw=new FileWriter(newTxt);
BufferedWriter bw = new BufferedWriter(fw);
bw.write("This is my Prog");
}
catch(Exception e){e.printStackTrace();}
}
}
这是我的代码....但我不知道为什么我会收到错误:/
答案 0 :(得分:0)