It is easy to limit the functionality of an array to make it work as a particular queue or stack data structure. I personally believe that instead of using the array object directly, it is better to constrain it to the methods required by the job instead of leaving every method public that can be misused by other programmers.