Ask your own question, for FREE!
Computer Science 9 Online
OpenStudy (anonymous):

Which of the following provides the index of the highest numbered element of the array strNames? A) strNames.Length - 1 B) strNames.Length C) strNames.Length + 1 D) None of the above

OpenStudy (anonymous):

I think I know it but i want clarification

OpenStudy (anonymous):

meaning you want the last element in the array ? if so ; then its A because array indexing starts from 0 meaning if u have one element it will be in strNames[0] , however strNames.Length will return 1.

OpenStudy (kainui):

Since an Array orders things starting from an index of 0, if you have 3 items you'll have item[0], item[1] and item[2] as your 3 items. So the length will give you the number 3. But there's no item[3]! So the correct answer must be length-1!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!