[Nottingham] Introduction and Java Question

Michael Erskine msemtd at googlemail.com
Mon Oct 20 07:57:15 UTC 2008


2008/10/19 Peter Chang <Peter.Chang at nottingham.ac.uk>:
> Looking at your code more closely, there's issues with 0-indexing, upper
> bounds on your array access, whether Java arrays are zero-initialised (I
> don't know Java) and the use of frequency.length as the upper limit
> (rather than freqIndex).

I can confirm that a Java array of int primitives will be zero
initialised and for the upper bounds, to quote
http://java.sun.com/docs/books/jls/third_edition/html/arrays.html
"If an array has n components, we say n is the length of the array;
the components of the array are referenced using integer indices from
0 to n-1, inclusive."

Regards,
Michael Erskine



More information about the Nottingham mailing list