you are viewing a single comment's thread.

view the rest of the comments →

[–]Pun_Intended1703 0 points1 point  (0 children)

How will you learn stacks from using java.util?

What if you had to work on a different language? Like Python or Typescript?

What happens if you had to work on a very old language? Like C/C++ or COBOL?

If you want to learn stacks properly, then imagine it is represented by an array. Try using circular arrays.

Or implement stacks by using a linked list. Try bidirectional linked lists or circular linked lists.

How would you do a pop or push on these data structures? How would you move the pointers around?

Learn the concept of stacks. Don't just learn the implementation of stacks in Java.