The output you see is from the toString method of Object class. Does your LinkedStack class have its own toString method?