Forums Register Login

Reference problem

+Pie Number of slices to send: Send
Hi all,
File fileref=new File("D:/Images/sd.jpg");

having fileref now..
what my doubt is can i make this fileref to a stringref..?
so that i can perform string manipulation
is it possible?

Regards
Kirba.
+Pie Number of slices to send: Send
Dear kirba devi,
Do you mean you want to obtain the path ("D:/Images/sd.jpg") for the file and then manipulate that file path? You can make use of tons of methods available in File class. Check out the Java API for more details.
+Pie Number of slices to send: Send
hi Shyam,
i want the file object to be converted to String object.
so i can do String manipulation..
ie File imagefile=new File("D:/Imsage/sd.jpg");

String name=imagefile.toString();

can i do like this???

Regrads
Kirba.
+Pie Number of slices to send: Send
When you say that you want the file object converted to a String object. Do you want to convert the name of the File or the contents of the File.

More importantly this is not conversion. You are just accessing the information from the File reference.
When you have exhausted all possibilities, remember this: you haven't - Edison. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 594 times.
Similar Threads
Java 7 Confusion
Possible issue with Java 7
How to Convert DTD file into XFLAT file
OS notifying file system changes
File uploading in flex
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 02:36:25.