Publicis Sapient Interview Question

Write a program on a Stack (LIFO) method.