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.
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
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
import java.util.concurrent.*;
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.
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.*;
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Luckily, Java provides us with the normalize(Path)
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
List<String> data = new ArrayList();
The first method, Files.readAttributes(), returns a read-only view ...
...The second method, Files.getFileAttributeView(), returns
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
...the path value after the first line is just the current directory symbol.
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
D is incorrect, as adding settings is the opposite ...
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
The findAny() and findFirst() methods return an element of the stream unless the stream is empty.
If the stream is empty, they return an empty Optional.
Juerg Bauman wrote:On page 191:
The findAny() and findFirst() methods return an element of the stream unless the stream is empty.
If the stream is empty, they return an empty Optional.
These methods return an Optional in any case, wether the stream is empty or not.
It sould be something like: ... methods return an Optional wrapping an element of the stream ...
Juerg Bauman wrote:On page 193:
This code snippet is intended to fail, anyway. Stream s is defined without generics and raw typing shouldn't be used anymore.
So better would be: Stream<Integer> s = ...
Campbell Ritchie wrote:. . . or an explanation of the unchecked compiler warning?
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
...use BufferedReader/BufferedWriter directly on a stream.
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
The UPDATE statement changes one or more rows in the database:
The DELETE statement deletes one or more rows in the database:
UPDATE: Change zero or more rows in the table
DELETE: Remove zero or more rows from the table
Juerg Bauman wrote:On page 511:
The UPDATE statement changes one or more rows in the database:
The DELETE statement deletes one or more rows in the database:
In both cases it should be: ... zero or more rows ... as shown one page earlier:
UPDATE: Change zero or more rows in the table
DELETE: Remove zero or more rows from the table
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Juerg Bauman wrote:On page 91, Figure 2.9:
The name of the class "ZooKeeper" declared in the factory pattern example doesn't match with figure 2.9, where the same class is called "Client". The other class names are identical in description and figure.
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
16: String str = "abc";
17: Predicate<String> methodRef2 = str::startsWith;
...
Line 17 shows that we want to call string.startsWith()
A Duration is stored in hours, minutes, and seconds.
This class models a quantity or amount of time in terms of seconds and nanoseconds.
Then you start the task by using the Thread.start() method.
...make sure that you remember to start the task with the Thread.start() method.
Implementing Runnable allows the class to be used by numerous Concurrency API classes.
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Create an array of that static type. This one is the most annoying, but it makes sense
because you’d be creating an array of Objects.
By default, the move() method will follow links, ...
These behaviors can be changed by providing the optional values NOFOLLOW_LINKS , REPLACE_EXISTING , or ATOMIC_MOVE , ...
If the file is a symbolic link then the symbolic link itself, not the target of the link, is moved.
The append() method throws an IOException.
Methods in this class never throw I/O exceptions, ...
PI day is 3.14 (march 14th) and is also einstein's birthday. And this is merely a tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
|