give path of some existing file there. you cant read from a non existing file.
Joined: Apr 26, 2012
Anurag Verma wrote:give path of some existing file there. you cant read from a non existing file.
sir i am really sorry for not being able to reply for such a long time... I was not well..
first of all i would like to thank you that you are taking so much pain in helping me out with my project..
Sir i got your point that in my coding i had given path of the file that does not really exist...Can you please tell me how to read from a current file(as in the file in which you are presently working) without giving the name of the file...(as in file=new file(name of file)...)
In java "." represents the current directory is there anything that represents the current file???
There is no such thing as "the current file". If you want your Java program to read from a file, then you have to give it the path (not just the name part, the full path) to a file which actually exists.