Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Invalid escape sequence (valid ones are \b \t \n \f \r \" \' \\ )

807600Jul 13 2007 — edited Jul 13 2007
when I try to create a new file using:
File file = new File("C:\Documents and Settings\username\My Documents\Eclipse Workspace\CH10_BasicIO\ch10\datafile1");
I get the following error:
- Invalid escape sequence (valid ones are \b \t \n \f \r \" \' \\ )

Why isn't what I'm sending as an argument a valid pathname?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 10 2007
Added on Jul 13 2007
10 comments
6,755 views