Which functional interface takes zero parameters and has a get() method?
Besides itself, which primitive types can be implicitly cast to int?
What are the names of the options available to set a classpath in a java or javac command?
Which three functional interfaces can fill in the blanks to make the code compile? (Choose three.)
Lines 6 and 7 both call the method applyAsDouble() rather than apply(). This tells us that the answer is a primitive functional interface, ruling out options C and D. The primitive versions are correct with options E and F. Line 8 calls accept(), making it a consumer. Option A is the remaining correct answer.
Finally, Eagle does not compile because it declares an abstract method soar() in a concrete class, making option D correct.
Enthuware - Best Mock Exams and Questions for Oracle Java Certifications
Quality Guaranteed - Pass or Full Refund!
Did you quote that question exactly? It is not quite precise; functional interface don't have parameters. Their methods have parameters. I think you are correct about Supplier however.Radek Novotný wrote:. . .
Which functional interface takes zero parameters and has a get() method?
And on the other side is Consumer. I think it should be Supplier.
Agree: see JLS (=Java® Language Specification). I haven't got the time to look at your other points, but shall award you a cow for the effor you put into that post.. . .
Besides itself, which primitive types can be implicitly cast to int?
There is byte and short, what about char? . . .
Campbell Ritchie wrote:
Did you quote that question exactly? It is not quite precise; functional interface don't have parameters. Their methods have parameters. I think you are correct about Supplier however.Radek Novotný wrote:. . .
Which functional interface takes zero parameters and has a get() method?
And on the other side is Consumer. I think it should be Supplier.Agree: see JLS (=Java® Language Specification). I haven't got the time to look at your other points, but shall award you a cow for the effor you put into that post.. . .
Besides itself, which primitive types can be implicitly cast to int?
There is byte and short, what about char? . . .
And (again) congratulations
Radek Novotný wrote:
Which functional interface takes zero parameters and has a get() method?
And on the other side is Consumer. I think it should be Supplier.
Radek Novotný wrote:
Besides itself, which primitive types can be implicitly cast to int?
There is byte and short, what about char?.
Radek Novotný wrote:
What are the names of the options available to set a classpath in a java or javac command?
There is -cp, --classpath, and -class-path, but should be --class-path and -classpath.
Radek Novotný wrote:Also there was question about what commands takes module path and answer was like: "java, javac, jlink, jdeps takes -p or --module-path ..." - but jdeps takes only --module-path, -p means package according to study guide and --help command.
[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
Radek Novotný wrote:2. Practice exam 3
Which three functional interfaces can fill in the blanks to make the code compile? (Choose three.)
Options:
A. Consumer<Double>
B. DoubleConsumer
C. Function<Long, Double>
D. Function<String, Double>
E. LongToDoubleFunction
F. ToDoubleFunction<String>
Explanation:
Lines 6 and 7 both call the method applyAsDouble() rather than apply(). This tells us that the answer is a primitive functional interface, ruling out options C and D. The primitive versions are correct with options E and F. Line 8 calls accept(), making it a consumer. Option A is the remaining correct answer.
I was wondering why DoubleConsumer was not correct answer.
[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
Radek Novotný wrote:
3. Book
Answers and explanations, chapter 14, typo in bold:
B, C, E. Options B and C are properties of NIO.2 and are good reasons to use it over the java.io.File class. Option A is incorrect as both APIs can delete only empty directories, not a directory tree. Using a view to read multiple attributes leads to fewer round trips between the process and the file system and better performance, making option E correct. Views can be used to access file system–specific attributes that are not available in Files methods; therefore, option D is correct. Files is part of NIO.2, whereas File is part of java.io, which means option F is incorrect.
Radek Novotný wrote:
Review questions, chapter 7, question 28:
Finally, Eagle does not compile because it declares an abstract method soar() in a concrete class, making option D correct.
And also missing return type
[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
Enthuware - Best Mock Exams and Questions for Oracle Java Certifications
Quality Guaranteed - Pass or Full Refund!
Enthuware - Best Mock Exams and Questions for Oracle Java Certifications
Quality Guaranteed - Pass or Full Refund!
sj Jabbar wrote:Thanks for the response, But still not understand how -56 is the results.
200-56=144 // still not -56/correct
200-128=72 // still no -56/correct
Would you elaborate picture please. What is the formula used here.
sj Jabbar wrote:Hi All,
I bough a OCP 17 hard copy. would like to know where to find source code in GIT for the examples given in the book.
please share the link.
[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
sj Jabbar wrote:Is my understanding is correct to add class name with a command ?
[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
Jhonson Fernando
MyExamCloud | AI Exam Generator | 1Z0-830 Practice Tests | 1Z0-829 Practice Tests | 1Z0-811 Practice Tests | 1Z0-900 Practice Tests | PCAP Practice Tests | PCEP Practice Tests | PCPP1 Practice Tests
Jeanne Boyarsky wrote:
sj Jabbar wrote:Is my understanding is correct to add class name with a command ?
You are correct. I've added this to the errata
Manuel Trumm wrote:
Jeanne Boyarsky wrote:
sj Jabbar wrote:Is my understanding is correct to add class name with a command ?
You are correct. I've added this to the errata
What exactly is wrong in the book? I see a . (dot) in all jar commands on page 20 for the class names.
[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:
Manuel Trumm wrote:
Jeanne Boyarsky wrote:
sj Jabbar wrote:Is my understanding is correct to add class name with a command ?
You are correct. I've added this to the errata
What exactly is wrong in the book? I see a . (dot) in all jar commands on page 20 for the class names.
It's not a missing dot. It is a missing "class".
[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
She's out of the country right now, toppling an unauthorized dictatorship. Please leave a message with this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|