X355: ArrayBasedStack toArray

Write the ArrayBasedStack member method toArray. The method returns an Object array with a copy of each element in the stack with the top of the stack being the last element. Recall that the ArrayBasedStack has three fields: T[] contents; int numberOfEntries; int capacity;

Your Answer:


Practice a different Java exercise


Your feedback will appear here when you check your answer.