• Post Reply Bookmark Topic Watch Topic
  • New Topic

Where is my output.txt file?

 
K Barnes
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to add file output (to output.txt) to my code. When, I run my code in NetBeans, it complies but nothing displays. Where is my output supposed to show up? I'm a beginner and this is my first time trying this... Is there something missing in my code? Any pointers are much appreciated, thanks.

My assignment description says "Write the output from your Guitar class methods to a text file that a user entered from the command line arguments (e.g. java Mynamep3tst my filename.txt). This allows your program to accept filenames from the user via a command line argument.



My test class

 
Paul Clapham
Sheriff
Posts: 21876
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, welcome to the Ranch!

You'll find that file in the current working directory, since you didn't specify any path for it. You said you were running your code in NetBeans? I don't use NetBeans myself but chances are that it sets the current working directory to some directory which is part of the project you're working in. However if you want to make things simpler for yourself, don't let NetBeans decide which folder to put the file into. Decide for yourself; something like

 
Adamz Preston
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you need to find your current working directory.

you can do this by:

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!