aspose file tools
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

Win a copy of RabbitMQ in Depth this week in the Open Source forum!
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: 301

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: 19820

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.)
It is sorta covered in the JavaRanch Style Guide.
subject: Assing the value