Page 1 of 1

About Question enthuware.ocpjp.v8.2.1429 :

Posted: Tue Sep 06, 2016 11:31 am
by ramy6_1
Hello ,

At question enthuware.ocpjp.v8.2.1485 , you have mentioned that

"Therefore, Period.ofMonths(1).ofDays(1) will give you a Period of only 1 day. The previous call to ofMonths(1) does return an instance of Period comprising 1 month but that instance is irrelevant because ofDays is a static method."

Can you provide some explanation why the chain of calls working here in this question but it will fail in the mentioned case above ?

Re: About Question enthuware.ocpjp.v8.2.1429 :

Posted: Tue Sep 06, 2016 8:35 pm
by admin
In this question (2.1429), we are using instance methods, while question 2.1485 uses static methods. Both are two entirely different things.
You should go through the JavaDoc API description of these methods.