Skip to content

Commit

Permalink
Merge pull request #93 from robertgherlan/patch-1
Browse files Browse the repository at this point in the history
Fixed some typos
  • Loading branch information
eh3rrera authored May 27, 2020
2 parents 5ff7907 + afe391b commit c18f46a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ch16.html
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ <h2>java.util.Comparator</h2>
&nbsp; &nbsp; &nbsp; &nbsp; Comparator.comparing((Computer c) -&gt; c.id)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .thenComparing(c -&gt; c.brand);</code></p>

<p>Finally, the default method <code>reverse()</code> will create a <code>Comparator</code> that reverses the order of the original <code>Comparator</code>:</p>
<p>Finally, the default method <code>reversed()</code> will create a <code>Comparator</code> that reverses the order of the original <code>Comparator</code>:</p>

<p><code class="java hljs">List&lt;Computer&gt; list = Arrays.asList(c1, c2, c3, c4);<br />
Collections.sort(list,<br />
Expand Down Expand Up @@ -413,7 +413,7 @@ <h2>Key Points</h2>
</ul>
</li>

<li><code>comparing()</code>, <code>thenComparing()</code>, and <code>reverse()</code> are helper methods of the <code>Comparator</code> interface added in Java 8.</li>
<li><code>comparing()</code>, <code>thenComparing()</code>, and <code>reversed()</code> are helper methods of the <code>Comparator</code> interface added in Java 8.</li>

<li>The <code>sorted()</code> method of the <code>Stream</code> interface returns a stream with the elements sorted according to its natural order. You can also pass a <code>Comparator</code> as an argument.</li>

Expand Down Expand Up @@ -509,4 +509,4 @@ <h2>Self Test</h2>

</body>

</html>
</html>

0 comments on commit c18f46a

Please sign in to comment.