http://www.lifesbizzare.blogspot.com || OCJP:81%
Jeff Verdegan wrote:When you say "not reading" I assume you mean "not executing." I'm curious as to why you would think that.
I'm also curious as to why, after nearly 1,000 posts here, you're still ignoring exceptions, rather than at least printing a stack trace.
http://www.lifesbizzare.blogspot.com || OCJP:81%
Maneesh Godbole wrote:FileReader will try to "read",it won't create.
the [tt]existingDir1.mkdir(); [//tt] returns a boolean to indicate if the file was created. Check that value to see why the file is not being created.
http://www.lifesbizzare.blogspot.com || OCJP:81%
http://www.lifesbizzare.blogspot.com || OCJP:81%
Vishal Hegde wrote:
why it is giving the value as false even after a directory is being created?
Jeff Verdegan wrote:
Vishal Hegde wrote:
why it is giving the value as false even after a directory is being created?
If it's returning false, then it did not create the directory. This is a fact. You're assuming it created the directory, but it did not.
http://www.lifesbizzare.blogspot.com || OCJP:81%
Vishal Hegde wrote:
Jeff Verdegan wrote:
Vishal Hegde wrote:
why it is giving the value as false even after a directory is being created?
If it's returning false, then it did not create the directory. This is a fact. You're assuming it created the directory, but it did not.
No, I am not assuming I Just tried the code and checked it.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Jeff Verdegan wrote:No, I am not assuming
http://www.lifesbizzare.blogspot.com || OCJP:81%
Vishal Hegde wrote:Thank you Jeff , I understood where I was going wrong and enjoying the process of asking questions over here.What I was doing was on line 7 i was making dir.mkdir() which at that point is creating directory and on line 8 I am simply using sysout to print true or false as the directory is already created on line 7.. Line 8 will obiviously return false.Below is the code
Don't get me started about those stupid light bulbs. |