Page 1 of 1

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
by answerhappygod
Suppose We Want To Create A Stack Class That Can Store Objects Of Any Java Class What Would Be The Best Technique To Us 1
Suppose We Want To Create A Stack Class That Can Store Objects Of Any Java Class What Would Be The Best Technique To Us 1 (10 KiB) Viewed 34 times
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