Skip to content

Commit

Permalink
Merge pull request #90 from gcarravi/Fix-to-Key-Points-in-Chapter21
Browse files Browse the repository at this point in the history
Fix to key points in chapters 22, 24 and 29
  • Loading branch information
eh3rrera authored Jan 29, 2020
2 parents c89857c + ce96bab commit 3d66190
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions ch22.html
Original file line number Diff line number Diff line change
Expand Up @@ -1011,9 +1011,10 @@ <h2>Key Points</h2>

<li>If you want to create a specific <code>ZoneId</code> object use the method <code>of</code>:<br />
<code class="java hljs">ZoneId.of(<span class="hljs-string">"Asia/Singapore"</span>);<br />
ZoneId.of(<span class="hljs-string">"+3"</span>)</code></li>
ZoneId.of(<span class="hljs-string">"+3"</span>);<br />
ZoneId.of(<span class="hljs-string">"Z"</span>);</code></li>

<li>The first two of the above methods produce an object of type <code>ZoneRegion</code>. The last one, an object of type <code>ZoneOffset</code>.</li>
<li>The first one of the above methods produces an object of type <code>ZoneRegion</code>. The other two produce an object of type <code>ZoneOffset</code>.</li>

<li>A <code>java.time.ZonedDateTime</code> object represents a point in time relative to a time zone.</li>

Expand Down
6 changes: 3 additions & 3 deletions ch24.html
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ <h2>The Path interface</h2>

<p>If both paths are absolute, the result is system-dependent.</p>

<p><code>Path</code> implements the <code>Iterable</code> interface so you can do something like this:</p>
<p><code>Path</code> extends the <code>Iterable</code> interface so you can do something like this:</p>

<p><code class="java hljs">Path path = Paths.get(<span class="hljs-string">"c:\\temp\\dir1\\file.txt"</span>);<br />
<span class="hljs-keyword">for</span>(Path name : path) {<br />
Expand All @@ -283,7 +283,7 @@ <h2>The Path interface</h2>
dir1<br />
file.txt</code></p>

<p><code>Path</code> implements the <code>Comparable</code> interface and the <code>equals()</code> method to test two paths for equality.</p>
<p><code>Path</code> extends the <code>Comparable</code> interface and the <code>equals()</code> method to test two paths for equality.</p>

<p><code>compareTo()</code> compares two paths lexicographically. It returns:</p>

Expand Down Expand Up @@ -656,7 +656,7 @@ <h2>Key Points</h2>

<li>The absolute path representation of a <code>Path</code> object has a root component (either <code>c:\</code> or <code>/</code>) and a sequence of names separated by a (forward or backward) slash.</li>

<li>The <code>Path</code> interface has methods get the elements of the path, normalize paths, and get attributes of the path (isAbsolute(), getFileSystem(), etc), among others. It also implements <code>Comparable</code> and <code>equals()</code> to test for equality.</li>
<li>The <code>Path</code> interface has methods to get the elements of the path, normalize paths, and get attributes of the path (isAbsolute(), getFileSystem(), etc), among others. It also extends <code>Comparable</code> and implements <code>equals()</code> to test for equality.</li>

<li>The <code>java.nio.file.Files</code> class has static methods for common operations on files and directories. In contrast with the <code>java.io.File class</code>, all methods of <code>Files</code> work with <code>Path</code> objects.</li>

Expand Down
2 changes: 1 addition & 1 deletion ch29.html
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ <h2>Self Test</h2>



<p>5. Which of the following can be a valid way to get the value of the first column of a row?<br /> A. <code>rs.getInteger(1);</code><br /> B. <code>rb.getString("0");</code><br /> C. <code>rb.getObject(0);</code><br /> D. <code>rb.getBoolean(1);</code></p>
<p>5. Which of the following can be a valid way to get the value of the first column of a row?<br /> A. <code>rs.getInteger(1);</code><br /> B. <code>rs.getString("0");</code><br /> C. <code>rs.getObject(0);</code><br /> D. <code>rs.getBoolean(1);</code></p>



Expand Down
2 changes: 1 addition & 1 deletion ch29a.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ <h2>Answers</h2>

<p><br /></p>

<p><b>5. The correct answer is D.</b><br /> Option A is invalid. The method <code>getInteger()</code> doesn't exist (the correct one is <code>getInt()</code>).<br /> Option B is invalid. The string argument must be the name of the column.<br /> Option C is invalid. In JDBC, indexes start at <code>1</code>.<br /> Option D is valid. <code>rb.getBoolean(1)</code> can be a valid way to get the value of the first column of a row.</p>
<p><b>5. The correct answer is D.</b><br /> Option A is invalid. The method <code>getInteger()</code> doesn't exist (the correct one is <code>getInt()</code>).<br /> Option B is invalid. The string argument must be the name of the column.<br /> Option C is invalid. In JDBC, indexes start at <code>1</code>.<br /> Option D is valid. <code>rs.getBoolean(1)</code> can be a valid way to get the value of the first column of a row.</p>
<p><br /></p>

</div>
Expand Down

0 comments on commit 3d66190

Please sign in to comment.