This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Assing the value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Assing the value" Watch "Assing the value" New topic

Assing the value

pankaj semwal
Ranch Hand

Joined: Oct 07, 2008
Posts: 302

I want to put the following path in a variable

like String str=C:\Documents and Settings\Administrator\Desktop

But its showing error.

Please help me how to solve this problem

Henry Wong

Joined: Sep 28, 2004
Posts: 20040

It's probably a good idea to use quotes around a string literal... And escape the backslashes too...


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Lucas Franceschi
Ranch Hand

Joined: Nov 10, 2008
Posts: 106

why dont you post us your error?

but, i probably think that its exactly what henry said...

try doing this

should work

Lucas Franceschi
Software Developer for SGI Sistemas,
Lucas Franceschi
Ranch Hand

Joined: Nov 10, 2008
Posts: 106

oh, and you probably mean assign, when you say assing, right?

(UPD: i'm starting to go crazy, i'm typing non-sense things.)
Have you checked out Aspose?
subject: Assing the value
It's not a secret anymore!