Publicis Sapient interview question

Write a program on a Stack (LIFO) method.