I am a beginner who just started reviewing.refreshing my java skills again. I tried coding a simple thing that would read input from a file and print the output.....
I am using eclipse (which I am also finding a little complicated) and I the code and output are given below. I am currently in the workspace where my code and file are located. Instead of typing in the entire pathname, I tried just the file name as well and I am still getting this error.
First, a bit of business: you may not have read our naming policy on the way in. It requires that you use a full, real (sounding) first and last name for your display name. Nicknames and "handles" don't cut it. You can change your display name here. Thanks!
As far as your problem goes: FileNotFoundException is awfully clear: as far as the Java program is concerned, the file isn't there. When you're running under an IDE, the problem is generally that the current directory isn't where you think it is. The solution is to use an absolute path (when you did try this, you likely made a slight mistake; try again!) or to find out where the current directory actually is. Try something like