Page 1 of 1

About Question enthuware.ocpjp.v8.3.1922 :

Posted: Sun May 12, 2019 10:03 am
by Cannelids
Hi - Re the explanation for why the fourth option does not compile:
"Since the variable names is of type List<String>, its addAll method can only accept objects whose declared type is a String. Declared type of oa[0] and oa[1] is Object and therefore it will not compile. The compiler doesn't know that these elements actually hold Strings"
I think this is a bit off in that the method need a List<String>, not just individual Strings, so even if the elements passed here were typed to String it still would not compile.

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

Posted: Sun May 12, 2019 10:17 am
by admin
You are right. The explanation is off. Fixed.

thank you for your feedback!

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

Posted: Sun May 12, 2019 11:13 am
by Cannelids
Thanks!