• Post Reply Bookmark Topic Watch Topic
  • New Topic

Sybex OCP Java 8 Study Guide - Page 346  RSS feed

 
Juerg Bauman
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On page 346:
ScheduledFuture<V> is identical to the Future<V> class, except that it includes a
getDelay() method that returns the delay set when the process was created.


The API_documentation states about the getDelay() method:
Returns the remaining delay associated with this object, in the given time unit.
Returns:
the remaining delay; zero or negative values indicate that the delay has already elapsed
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37469
539
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Correct. I checked with Scott and he said the delay decreases over time as execution approaches.
 
Juerg Bauman
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
on page 563 - explanation to exercise 10:
The problem here is that c1 is a String but c2 is an int, 

It's the opposite way: c1 is an int, and c2 a String.
 
Juerg Bauman
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On page 401 - exercise 17:
there is an import statement which is incomplete, the code doesn't compile
import java.util.concurrent.*;


You must add: import java.util.concurrent.atomic.*;
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37469
539
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Juerg Bauman wrote:on page 563 - explanation to exercise 10:
The problem here is that c1 is a String but c2 is an int, 

It's the opposite way: c1 is an int, and c2 a String.

Agreed. This is already listed on our errata page.

Juerg Bauman wrote:On page 401 - exercise 17:
there is an import statement which is incomplete, the code doesn't compile
import java.util.concurrent.*;


You must add: import java.util.concurrent.atomic.*;

The instructions on the exam tell you to assume any required imports are there. So missing imports are not errata.
 
Juerg Bauman
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On page 469:
Luckily, Java provides us with the normalize(Path)

normalize() is an instance method and doesn't take a Path argument.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37469
539
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Confirmed and added to the errata. Thanks!
 
Juerg Bauman
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On page 477: the example with newBufferedWriter
it's not really an error, just a needless line of code:
List<String> data = new ArrayList();

List data isn't needed anywhere in that example.
 
Juerg Bauman
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On page 484:
The first method, Files.readAttributes(), returns a read-only view ...
...The second method, Files.getFileAttributeView(), returns

In the previous pages you always mentioned the complete method signatures, incl. parameters.
So in this case it should be:
Files.readAttributes(Path, Class<V>)
Files.getFileAttributeView(Path, Class<A>)
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37469
539
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Juerg,
Neither of those are errors. Inconsistencies, sure. But not errors.
 
Juerg Bauman
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
on page 571, explanation to question 20:
...the path value after the first line is just the current directory symbol.


The path value after normalize() is empty, so doesn't contain the current directory symbol --> path.toString().isEmpty() outputs true.
Nevertheless getNameCount() results in 1 and the answer B is correct.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!