I'm currently experimenting with creating files and directories. I've learned that it's good practice to "play" with code in order to gain a better understanding of how something works or doesn't work.
Take a look at the following code:
Now when i compile the program, i expect an exception to occur because the call to "mkdir' has been purposely omitted. However, the code compiles fine. However, when i look in the 'bin' directory, the "dexDir" is not there.
My question is why didn't the program throw an exception? Is there something i did wrong or omitted from the code?
Thanks in advance..... [ September 17, 2008: Message edited by: Derek Harper ]
You're exactly right because once i added the e.printStackTrace() to the code, i got the following:
java.io.IOException: The system cannot find the path specified at java.io.WinNTFileSystem.createFileExclusively(Native Method) at java.io.File.createNewFile(File.java:883) at NoFileDirDemo.main(NoFileDirDemo.java:11)
subject: I/O - creating a directory vs. not creating a dir