HEXAQ : A friendly question - answer site for IT professionals

Java - illegal escape character


0

I am newbie to Java.

In my code I am trying to access a file from local file system. I'vd assigned path of my file to a variable and that gives error message.

illegal escape character

This is my code line:

String s = "C:\Java\work\contacts.txt";

Whats wrong with my code?

Â
asked
 


≡ Total 1 Answer

0

This is related to valid escape characters.

you should write your string in correct ways as per JAVA.

Update your statement as my one below

String s = "C:\\Java\\work\\contacts.txt";
Â
replied


Enter your reply here
Answer Preview:
Viewed: 861 times
Asked on: 10/1/2013
Permalink
Topics in this question
  2
Search Question
Similler Questions