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?
About Question enthuware.ocpjp.ii.v11.2.3401 :
Moderator: admin
-
- Posts: 8
- Joined: Sun Feb 23, 2020 6:51 am
- Contact:
-
- Site Admin
- Posts: 10062
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.ii.v11.2.3401 :
Yes, you may get such options.
If you like our products and services, please help us by posting your review here.
-
- Posts: 8
- Joined: Sun Feb 23, 2020 6:51 am
- Contact:
Re: About Question enthuware.ocpjp.ii.v11.2.3401 :
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.)
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.)
-
- Site Admin
- Posts: 10062
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.ii.v11.2.3401 :
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.
Who is online
Users browsing this forum: No registered users and 53 guests