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.
As you see, the first two methods return me the absolutePath and canonicalPath, but the absolutePath is actually "C:\Workspace\LearnJava\src\resources\sample.properties" , "src" is missing in the output.
But the real question is, when getAbsolutePath() returns me an output, whether correct or not, why the other methods returning me false. If exists() is returning false, that means it could not find the file, but then it should not return the absolutePath() also.
If I change the resource folder to the LearnJava folder level instead of src level, then the output is