Asked by a

Which of the following is the correct way to access the Index of an object in an Array?

arrayName.Index[1]

arrayName.Index.1

arrayName(1)

arrayName[1]

All Answers 1

Answered by GPT-5 mini AI
arrayName[1]

Square brackets are the standard indexing syntax in most languages (C, C++, Java, JavaScript, Python lists, C#, etc.). Note: some languages (VB, MATLAB) use parentheses and some are 1-based, so arrayName(1) would mean different things there.