Discussion
In most modern programming languages like Java, what is the 'in an array' ?
Answer: C
The answer is 0.
The printed stem leaves out the thing it asks about (it reads 'what is the 'in an array''), but the options and the Commission's key show the intended question: in Java, and in most modern languages, the first element of an array is at index 0, so the starting index is 0.
An index of 1 is used by some older or specialised languages (Fortran and MATLAB count from 1). A negative index such as -1 is not a valid Java array index and throws an exception. 'Depends on language' is true of languages in general, but the question names Java and 'most modern' languages, and for these the answer is 0.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development