This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I'm a little fuzzy on a concept. I thought Java would not let you to create a new file unless it did not already exist. But know I understand that FileWriter and FileOutputStream constructors replace the original files when constructing with existing file name. I thought the former were for security principles.
No, you can create new files and update or overwrite existing files in Java. In an applet you have no access to files other than those in the directory that contains the applet (for icons etc). You can also delete files and directories using the delete() method for a File object. If you don't want to overwrite an existing file in a Java application, be sure to use the FileOutputStream constructor with two arguments with the second argument (append) specified as true.
Ivor Horton<br />Author of the Beginning Java Series including the new <a href="http://www.amazon.com/exec/obidos/ASIN/1861005695/ref=ase_electricporkchop" target="_blank" rel="nofollow">Beginning Java 2 SDK 1.4 Edition</a>
Joined: Jul 18, 2001
Well Thanks Ivor, Thanks for clearing that up. I't was just something erroneous I had in my head.