Page 1 of 1

About Question enthuware.ocpjp.v7.2.1406 :

Posted: Tue Aug 13, 2013 3:51 am
by laura90_m@yahoo.com
The last option

Code: Select all

public void assertTest(List v) {     assert v.size() == 10 : v.add("hello"); }
is indicated to be invalid:
Invalid because boolean : void does not satisfy <boolean_expression> : <any_expression_but_void>
Also, in the explanation, it is said that
Also, v.add(...) returns void. So option 5 is not valid.
But v is a List and add() method returns a boolean, not void. So option 5 is actually valid.

And one more thing: the explanation also contains this:
Option b is invalid because the first operand must be a boolean but here it is a Vector object.
But we do not have Vector objects in this option, we have List objects.

Re: About Question enthuware.ocpjp.v7.2.1406 :

Posted: Tue Aug 13, 2013 9:43 am
by admin
You are right. I changed it from vector to list a few days ago and I broke it :(

Fixed now.

thank you for your feedback!