Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当 eclipse 创建一个文件(比如 feeds.txt)时,该文件会自动保存并从 eclipse 文件夹(不是工作区/项目文件夹)中读取。如何将其更改为工作区/“项目名称”文件夹
顺便说一句,我用这个:
private static final String feedFile = " Feeds.txt";
你用它做什么?..如果这样命名,eclipse应该在项目文件夹中创建一个新文件试试这个
import java.io.*; try { File file = new File("Feeds.txt"); file.createNewFile(); } catch (IOException e) { }
http://www.exampledepot.com/egs/java.io/createfile.html