If I place text file in same project folder, program can read it without problems.
But how can I make it read a file from somewhere in my computer (ex: in Desktop)
FileInputStream fstream = new FileInputStream("Contact.txt");
I change it to “C:…\Desktop\Contact.txt”) but I getting error.
Change the backslash (
\) to forwardslash(/) or use double backslashes (\\) in your file path.or
Please Note:
\is an escape character. If you use\\, it will use single\as literal.