BIRLA
INSTITUTE OF TECHNOLOGY & SCIENCE, PILANI
SOFTWARE DEVELOPMENT & EDUCATIONAL TECHNOLOGY UNIT
SDET C102, CORE JAVA
LAB-5 : 26/10/07
1. Design a Stack data structure using ArrayList class. You should implement the following methods: push() and pop(). Write another class called StackDemo and invoke the methods implemented.
2. Design a class called Single keeping in mind the following constraints. Only a single instance of the class should be allowed to create and same instance should be made to share by all the clients. (Clients here refer to the classes which use the class Single).
You should ensure that no additional instances are created accidentally. (Hint: use static)