#java coding for stack