Server Administration
A script stores server names in a zero-indexed array in this order: web01, app01, db01, backup01. Which server name does accessing index 2 return?
Show the answer
Correct answerC. db01
AWhy not this: app01 is the second element and has index 1.
BWhy not this: web01 is the first element and has index 0.
CWhy this is right: db01 is the third element and has index 2.
DWhy not this: backup01 is the fourth element and has index 3.
A zero-indexed array assigns index 0 to its first element, so index 2 returns the third element, db01. Choosing app01 confuses the index with a one-based position.