Question: Which of the following references the first and last elements in a nonempty array? A. trains[0] and trains[trains.length] B. trains[0] and trains[trains.length - 1] C.
Which of the following references the first and last elements in a nonempty array?
A. trains[0] and trains[trains.length]
B. trains[0] and trains[trains.length - 1]
C. trains[1] and trains[trains.length]
D. trains[1] and trains[trains.length - 1]
E. None of the above.
Step by Step Solution
★★★★★
3.51 Rating (151 Votes )
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
The correct answer is B trains0 and trainstrainslength 1 In ... View full answer
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
