Since Object, unlike String, does not have a method equalsIgnoreCase(), the lambda expression does not compile.
Since equalsIgnoreCase() expects a String instance as an input parameter, and not an Object, the lambda expression does not compile.
The design protects the password by clearing it from memory after it is entered.
While the process correctly clears the password from the char array in memory, it adds the value to the JVM string pool when it is converted to a String.
Which of the following can be independently inserted into the blank so the code can run without error for at least one SQL query?
I. System.out.println(rs.getInt(1));
II. rs.next(); System.out.println(rs.getInt(1));
III. if (rs.next()) System.out.println(rs.getInt(1));
A. II
B. III
C. I and III
D. II and III
E. I, II, and III
F. None of the above
If the SELECT statement has a function like count(*) or sum(*) in the first column, there will always be a row in the ResultSet, so II works as well.
so the code can run without error for at least one SQL query?
Let’s say we have a Reader instance that will produce the characters with the numeric values {1,2,3,4,5,6,7}. Which of the following are possible outcomes of executing the checkLottoNumbers() method with this Reader instance? (Choose two.)
A. An IOException on line 25
B. An IOException on line 27
C. 'c'-4 is returned.
D. 'd'-3 is returned.
E. 3-4 is returned.
F. 4-3 is returned.
The method does not call the markSupported() prior to calling mark() and reset(). This is considered a poor practice. The input variable could be a subclass of Reader that does not support this functionality. In this situation, the method would ignore the mark() call and throw an IOException on the reset() method, making Option A incorrect and Option B correct.
What is true about the following code? (Choose two.)
A. If using a JDBC 3.0 driver, this code throws an exception.
B. If using a JDBC 4.0 driver, this code throws an exception.
C. The resources are closed in the wrong order.
D. The resources are closed in the right order.
E. The Connection is created incorrectly.
F. The Statement is created incorrectly.
JDBC 3.0 drivers require a Class.forName() call. Since this is missing, Option A is correct, and Option B is incorrect.
You might know that you can skip Class.forName on a JDBC 3.0 driver that was ahead of its time in including the java.sql.Driver file in addition to the public driver class. For the exam, go with the simplified view of the world that says it is mandatory. Of course, you would probably be using a DataSource in the first place, making this a moot point.
Regardless, it needs to include the database name or alias.
If all the semicolons were changed to colons, Option D would be correct. I and V would still be incorrect because they don’t begin with the JDBC protocol and magic driver name as the first two components.
I. jdbc;box;magic
II. jdbc;magic;@127.0.0.1:1234
III. jdbc;magic;//@127.0.0.1:1234
IV. jdbc;magic;127.0.0.1:1234/box
V. magic;jdbc;127.0.0.1:1234/box
II. jdbc:magic:@127.0.0.1:1234
III. jdbc:magic://@127.0.0.1:1234
IV. jdbc:magic:127.0.0.1:1234/box
Roel De Nijs wrote:It would probably be better to create a seperate topic for each question errata report. In thi way each topic can have a dedicated discussion about that question and errata report, so follow-up will be much easier.
[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
[OCP 21 Professional Study Guide] [OCP 17 Complete Study Guide] [OCP 17 Practice Tests] [OCP 11 Complete Study Guide] [OCP 11 Programmer I] [OCP 11 Programmer II] [OCP 11 Practice Tests] [OCA 8] [OCP 8] [OCP 8 Practice Tests Book] [Blog]
[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
Jeanne Boyarsky wrote:OCP #18 - While the explanation might not be 100% correct, I still think the answer is.
Tamas Szekeres wrote:Sorry for the batch, at this point I was quite a bit frustrated with the book, and I only got back now with the free time to do the cutting up, but it's already too late.
[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
This is my favorite show. And this is my favorite tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|