About Question enthuware.ocpjp.ii.v11.2.3401 :

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

Moderator: admin

Post Reply
FlatPanda
Posts: 8
Joined: Sun Feb 23, 2020 6:51 am
Contact:

About Question enthuware.ocpjp.ii.v11.2.3401 :

Post by FlatPanda »

The accepted answer is partial (as discussed in the explanation text, the constructor should create a defensive copy of the Date object too).

Are such partially correct answers to be expected in the real exam?

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

Re: About Question enthuware.ocpjp.ii.v11.2.3401 :

Post by admin »

Yes, you may get such options.
If you like our products and services, please help us by posting your review here.

FlatPanda
Posts: 8
Joined: Sun Feb 23, 2020 6:51 am
Contact:

Re: About Question enthuware.ocpjp.ii.v11.2.3401 :

Post by FlatPanda »

But you don't get options, where one is partially correct and one is fully correct, right?

What I mean, there won't be a constellation, where for example next to answer "you should clone the Date in the getter" there is a "you should clone the Date in the constructor and the getter" too? Or in this case you should just pick the fully correct answer and ignore the partially correct one? (In multiple-choice questions there were compositions, which go into this direction, but in select-one question I haven't encountered such yet.)

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

Re: About Question enthuware.ocpjp.ii.v11.2.3401 :

Post by admin »

But there is no other option. Had there been an option saying Date should be cloned in the constructor, then you would pick that as well. In this case, Option 5 is the best option. It is true that the getDob method should return a clone of dob. There is no doubt about that, and so, you should select this option.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 26 guests