Win a copy of Kotlin for Android App Development this week in the Kotlin forum!

Tahir Abdullayev

Greenhorn
+ Follow
since May 16, 2017
Cows and Likes
Cows
Total received
1
In last 30 days
0
Total given
0
Likes
Total received
2
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Tahir Abdullayev

2 solutions: one with java streams and second with arrays and loops.

1 month ago
Hi,

Do you think previous experience in Java EE, servlets is needed to better understand basic concepts which Spring simplifies?
Doesn't it look like black magic without understanding basics?
1 year ago
Passed 1Z0-809 with 88% score big thanks to:
Jeanne Boyarsky & Scott Selikoff for most of what I've learned for this exam
Kathy Sierra & Bert Bates for their great OCP7 preparation book, I've used it for some topics.
Paul from enthuware and all enthuware team for their great mock tests.

My bad. I didn't checked errata for Mock exams. I thought it's only for the book.
Question:
Assuming the current directory is /home and the directories and files referenced by the program exist, what is true about the following code snippet? (Choose all that apply.)

Path path1 = Paths.get("/lemur/habitat/./party.txt");
Path path2 = path1.subpath(1,4).toAbsolutePath();
System.out.println(Files.lines(path2)
 .flatMap(p -> Stream.of(p.split(",")))
 .filter(s -> s.trim().length()>0)
 .allMatch(s -> s.length()>3));

A. It will access the file /lemur/habitat/party.txt.
B. It will access the file /habitat/party.txt.
C. It will access the file /home/habitat/party.txt.
D. If the String value ,,, is contained within the file, it will definitely print false.
E. If the String value ,hat, is contained within the file, it will definitely print false.
F. It will always print false.
G. The code does not compile

Answer: B, E
-----------
The problem is answer should be C, E. Even description inside answer matches C option. The description says:
"The value path1.subpath(1,4) returns habitat/./party.txt, which we join to the current directory /home with the toAbsolutePath() method in order to see that we are accessing the file /home/habitat/party.txt"

Hi,

I'm not sure where I should report this kind of errors.
I've found error in online mock exams for this book.
In batch 1 of online mock exams there is question 55 which is:
"Which of the following is least likely to be supported by your JDBC driver?"
the correct answer should be:
"E ResultSet.TYPE_SCROLL_SENSITIVE"

But if you check answer for this question it shows that answer B is correct, which is: ResultSet.CONCUR_UPDATABLE"

I think this should be corrected.