can anyone tell me how does the comparing take place between 2 files using compareTo() belonging to the File API. whether it only compares the path names or the contents of the File?
Thank you in advance
If you would have read the Javadoc of java.io.File you would have seen the following:
Compares two abstract pathnames lexicographically. The ordering defined by this method depends upon the underlying system. On UNIX systems, alphabetic case is significant in comparing pathnames; on Microsoft Windows systems it is not.
So no, it doesn't check the contents, just the result of getPath().