以下给了我一个FileNotFoundException: Invalid file path
String fileName = "folder/file" + "." + this.ext;
try {
File file = new File(fileName);
} catch(Exception e){
}
this.ext 之前已设置为"txt"
经过一番尝试后,我发现这效果非常好。
String ext = "txt";
String fileName = "folder/file" + "." + ext;
try {
File file = new File(fileName);
} catch(Exception e){
}
为什么我不能使用字段?
跃然一笑
潇湘沐
相关分类