Skip to Main Content

New to Java

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!

Converting .txt file into a string?

843785Nov 20 2008 — edited Nov 20 2008
I don't really know how to do this specific aspect of Java. I have a file that I'm just trying to convert into a string. Obviously this is wrong, but I tried to do a .toString() thing on there. Let me know if there's a better way of doing it that you know of?
File mazeFile = new File(filePath);
        String preMaze = mazeFile.toString();
Is there a better method of doing this?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 18 2008
Added on Nov 20 2008
2 comments
443 views