Where to put a textfile I want to use in eclipse?

后端 未结 9 632
误落风尘
误落风尘 2020-11-30 02:31

I need to read a text file when I start my program. I\'m using eclipse and started a new java project. In my project folder I got the \"src\" folder and the standard \"JRE S

9条回答
  •  [愿得一人]
    2020-11-30 03:02

    If this is a simple project, you should be able to drag the txt file right into the project folder. Specifically, the "project folder" would be the highest level folder. I tried to do this (for a homework project that I'm doing) by putting the txt file in the src folder, but that didn't work. But finally I figured out to put it in the project file.

    A good tutorial for this is http://www.vogella.com/articles/JavaIO/article.html. I used this as an intro to i/o and it helped.

提交回复
热议问题