Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Error in import java.io.File;

807588Apr 10 2009 — edited Apr 10 2009
I m having a problem when i import the following library...
import java.io.File;


netbeans underlines "File" and gives error "cannot find symbol"

i tried
import java.io.*;

but that doesn't allow:
File myFile= new File("fileName.txt");

here netbeans underlines "fileName.txt" and again gives error "cannot find symbol"

please tell me how to fix it...
In fact i m writing a code to rename a file.... i got a number of coeds from net but for every one either "import java.io.*;" or "import java.io.File;" is needed. If you have any other idea to "Rename a file" please share with me....
thx a lot
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 8 2009
Added on Apr 10 2009
16 comments
6,982 views