0

I am wondering how to phrase the following: my ArrayBlockingQueue list has space for ten entries (0-9); my question is, how would I write or phrase this?

Am I correct in saying, "ArrayBlockingQueue has ten indices", or "ArrayBlockingQueue has nine indices"?

I would imagine that the answer is "ten" but I just want to make sure.

Thank you.

1
  • Thank you all for your comments - I have always assumed that the correct way to phrase it would be to state that there are ten indices, as, even though the count begins from zero, zero itself still counts as one index position. Thank you everybody! Commented Mar 2, 2011 at 22:55

4 Answers 4

3

One does not normally speak of the indices as being a part of the array (after all, the indices don't physically exist), so I would say "ArrayBlockingQueue has ten elements". The number of elements is independent of the starting index, so it would be ten whether you start counting at 0, 1, or 42. If you want to specify that the indices start at 0, you'd say "ArrayBlockingQueue is a 0-based (or 0-indexed) array with ten elements".

0
1

I would definitely say 10 as 0 is an index. Any programmer with half a brain will understand that you're counting from 0.

1
  • People who program in Visual Basic (pre-.NET) or FORTRAN might not, since in both of these languages, you can choose your own base index, and the default is 1. :-) Commented Mar 2, 2011 at 23:36
0

It has ten indices, with the highest index denoted by 'index nine'.

Welcome to "counting-from-zero" :)

0

Real programmers count from 0!

But sadly, we must admit there are, in fact, 10 indices.

1
  • 2
    Hi. Do you mean 0 factorial (0!)? Or do you mean "not zero"? Commented Mar 2, 2011 at 23:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.