Suppose we want to create a stack class that can store objects of any Java class. What would be the best technique to us

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Suppose we want to create a stack class that can store objects of any Java class. What would be the best technique to us

Post 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 33 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply