How do you Implement a Stack using an ArrayList in java?

Java

1 answer

Answer

1063992

2026-04-12 20:10

+ Follow

Just add the elements to the end of the ArrayList, and take them out from the end of the ArrayList. Use the .add() method to add an element to the end; use the .size() method to find out how many elements it has (so you can access the last element), and use the .remove() method to eliminate this last element.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.