Page 1 of 1

About Question enthuware.ocajp.i.v7.2.913 :

Posted: Thu May 22, 2014 12:32 pm
by Nisim123
So why option 4 is not correct?
Option 4 of this question says:
Every array has an implicit method named 'length' which tells you the number of elements in the array.
:?

Re: About Question enthuware.ocajp.i.v7.2.913 :

Posted: Thu May 22, 2014 7:49 pm
by admin
It is incorrect because arrays do not have a method named length. They do have an implicit field name length.
HTH,
Paul.

Re: About Question enthuware.ocajp.i.v7.2.913 :

Posted: Fri May 23, 2014 2:12 am
by Nisim123
Yes, it actually does help, so BTW on what kind of objects we can say that they do
have a method named length()...?
:o

Re: About Question enthuware.ocajp.i.v7.2.913 :

Posted: Fri May 23, 2014 3:22 am
by admin
I don't have a list off hand but check the API for String, StringBuilder, List etc.

Re: About Question enthuware.ocajp.i.v7.2.913 :

Posted: Tue Mar 01, 2016 5:30 pm
by chronix
Is this a typo??

Every array has [in] implicit method named

Re: About Question enthuware.ocajp.i.v7.2.913 :

Posted: Tue Mar 01, 2016 7:11 pm
by admin
Yes, it should be "an". Fixed.
thank you for your feedback!