GfG QA is closing soon... Please refer PRACTICE or GfG now on wards !!

Heterogeneous Stack in Java

Write a Stack in Java.


1. It should support multiple data types. Ex: String, Integer, Double etc.

2. It should allow new data type to be registered with it.

3. In pop() method, it should return exact data type as was given by the client.

asked Sep 12, 2016 by Divya Garg 1