|
hi, i was going through java exercise and i did not understand this exercise. if you know anything, please post your comment here.
Suppose we have an array implementation of the stack class, with ten items in the stack stored at data[0] through data[9]. The CAPACITY is 42. Where does the push method place the new entry in the array?
A. data[0]
B. data[1]
C. data[9]
D. data[10]
|
|
|
Stack is a last-in-first-out stack of objects. Push places the new item on the top at index "0".
|
|
|
|
|
|
|
|