My Code is here: File f = new File("Test.txt"); long size = f.length(); This will give me size of the file but if it is 1 KB. If it is more than 1KB, it will give me 0. Why??? Thanks, Angela
Hi If you read the description of the method length(), it clearly says that the return value of length() will be 0L(long value) if it cannot find the specified file name on the disk. So in your example there may not be such file called Test.txt If you need more clarification, then use exists() method. cheers sivaPrasad
Everyone is a villain in someone else's story. Especially this devious tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth