Suppose we want to create a stack class that can store objects of any Java class. What would be the best technique to us
Posted: Fri May 20, 2022 1:12 pm
Suppose we want to create a stack class that can store objects of any Java class. What would be the best technique to use? Make Stack a generic class: public class Stack<E> Use overloaded methods Use a generic method Create a static method Create different versions of the Stack class for each object type