• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reference problem  RSS feed

 
kirba devi
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Shyam Prasad Murarka
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
kirba devi
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Anupam Sinha
Ranch Hand
Posts: 1090
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!