Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here is the implementation of both methods:</p> <pre><code>/** * Tests this abstract pathname for equality with the given object. * Returns &lt;code&gt;true&lt;/code&gt; if and only if the argument is not * &lt;code&gt;null&lt;/code&gt; and is an abstract pathname that denotes the same file * or directory as this abstract pathname. Whether or not two abstract * pathnames are equal depends upon the underlying system. On UNIX * systems, alphabetic case is significant in comparing pathnames; on Microsoft Windows * systems it is not. * * @param obj The object to be compared with this abstract pathname * * @return &lt;code&gt;true&lt;/code&gt; if and only if the objects are the same; * &lt;code&gt;false&lt;/code&gt; otherwise */ public boolean equals(Object obj) { if ((obj != null) &amp;&amp; (obj instanceof File)) { return compareTo((File)obj) == 0; } return false; } </code></pre> <pre><code>/** * 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. * * @param pathname The abstract pathname to be compared to this abstract * pathname * * @return Zero if the argument is equal to this abstract pathname, a * value less than zero if this abstract pathname is * lexicographically less than the argument, or a value greater * than zero if this abstract pathname is lexicographically * greater than the argument * * @since 1.2 */ public int compareTo(File pathname) { return fs.compare(this, pathname); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload