About Question enthuware.ocpjp.v11.2.3649 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
determinator
Posts: 1
Joined: Sat Sep 18, 2021 4:08 am
Contact:

Re: About Question enthuware.ocpjp.v11.2.3649 :

Post by determinator »

Hey!
why answer option:
for (Blogger b: loader) {b.blog ("Hello from textbook"); }
is it correct?

after all, the condition explicitly says:
"Assume that data refers to the data that needs to be blogged."

data stored in a variable named "data" MUST be posted on a blog.

And in this answer they post completely wrong data on the blog:
"Hello from textbook".

admin
Site Admin
Posts: 10384
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v11.2.3649 :

Post by admin »

Yes, it is correct. The data variable that you are referring to is the method parameter name. That is what the problem statement says, "...blog(String data) method of a blogging service...". As per the assumption, whatever this data variable points to will be blogged by the blog(String data) method.

When you call b.blog ("Hello from textbook"); , b is a reference to the blogging service and the String "Hello from textbook" will be assigned to the data variable of the blog method. In other words, within the blog method data will point to "Hello from textbook" and that will be blogged.

raphaelzintec
Posts: 167
Joined: Sun Apr 21, 2024 10:43 am
Contact:

Re: About Question enthuware.ocpjp.v11.2.3649 :

Post by raphaelzintec »

just explain why this question?

how could i know that loader.iterator() is correct if no mention about it in the PDF of mister Deshmukh??

the only mention about service loader are about modules and its very short

"Remember that java.util.ServiceLoader implements java.util.Iterable. Iterable" is not even mentionned in his pdf
Last edited by raphaelzintec on Tue Dec 17, 2024 12:50 am, edited 1 time in total.

admin
Site Admin
Posts: 10384
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v11.2.3649 :

Post by admin »

Who is mister desk??
Assuming that you are referring to https://amzn.to/3JHjZQv written by Hanumant Deshmukh , please see Section 4.5.2 Page 91:
test.png
test.png (54.96 KiB) Viewed 1965 times
If you have the PDF or Kindle, you can just search for a word by doing control F. If you have hard copy, you can look it up in the index. As you can see, it is explained in detail. You need to read it.

Note: If this is the book that you are referring to please refrain from mangling the name of the author. It is disrespectful. You wouldn't like people screwing up your name, would you?

raphaelzintec
Posts: 167
Joined: Sun Apr 21, 2024 10:43 am
Contact:

Re: About Question enthuware.ocpjp.v11.2.3649 :

Post by raphaelzintec »

yes mister Deshmukh sorry

Post Reply

Who is online

Users browsing this forum: Bing [Bot], witek_m and 12 guests