![]() |
| ||
| Renaming and deleting text files I have made this delete class of my address book program. It gives an error when I use the renameTo() function. Please look into my program. import java.io.*;Please tell me how to go about it. Thanks in advance. |
| ||
| Re: Renaming and deleting text files Here is part of description of this function, given by java help: public boolean renameTo(File dest) It asks a File as parameter, but you give String to it. |
| ||
| Re: Renaming and deleting text files http://java.sun.com/javase/6/docs/ap...(java.io.File) Check that out. It's expecting a file, not a string. It seems like you need to create a new file with a filename of what you want to rename the file to and pass that into renameTo(). |
| ||
| Re: Renaming and deleting text files Whoops, too slow. Check out the javadocs though, it might be helpful in explaining what you need to do. |
| All times are GMT -4. The time now is 6:43 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC