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: 10036
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.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 25 guests