The question is ambiguous (what is an exact year?), but I still believe there are three correct answers. The only one that is obviously wrong is lastYear3.
Campbell Ritchie
Marshal
Posts: 62804
203
posted 7 months ago
I was getting a bit confused by the documentation,, but if Stephan is correct and there are three right answers, then I shall worry a lot less.
First of all, thanks for the help, and you are correct, I should have provided my thoughts about the documentation and I guess this question is not 100% clear. It´s, as you mentioned, ambiguous.
All the answers would be correct, except for lastYear3 because we will have years with not exactly 365 days, also as called "leap years".
This is from Whizlabs by the way.
Thanks!
Campbell Ritchie
Marshal
Posts: 62804
203
posted 7 months ago
Are you sure you have copied the question exactly? I should have thought that Whizzlabs would have checked their questions carefully.
Leandro Takeda
Greenhorn
Posts: 14
posted 7 months ago
Yes, I did, I´m not sure If I can paste a screenshot here? I guess not.
I reviewed the question again and yes, it´s exactly the same!
Campbell Ritchie
Marshal
Posts: 62804
203
posted 7 months ago
We usually don't like screenshots for reasons explained here, but in these circumstances a screenshot would be OK. When you are replying, click the “attachments” tab.
Leandro Takeda
Greenhorn
Posts: 14
posted 7 months ago
There you go...
Screen-Shot-2018-06-27-at-3.03.08-PM.png
Stephan van Hulst
Saloon Keeper
Posts: 9703
192
posted 7 months ago
Huh. I'd ask them for an explanation.
Leandro Takeda
Greenhorn
Posts: 14
posted 7 months ago
Yeap, will do... thanks Stephan!
Leandro Takeda
Greenhorn
Posts: 14
posted 7 months ago
Whizlabs replied me and they pointed me to the "minusYear" method, as you see in the screenshot, the s is missing :/
So, it´s not minusYear. It´s minusYears, in the plural, so last lastYear1 and lastYear2 are the correct ones.
Now, a question for you guys which, of course, are more experient than me, does this kind of question really appear in the exam?
No. While the exam does enjoy tricking you, it doesn't enjoy tricking you on whether you missed one character in a method name. (Unless it is one that is highlighted in the cert books. For example Collections.sort exists. And there is a Collection class so that could in theory come up.