Your class is small and does what you said it should, that's good.
However, there are a few things you could do better.
You are using the
Integer type for counting the position and storing/returning data. If you actually used the fact, that it could be
null, this would be acceptable use. However, any instance of
null would break your code here. You are storing your integers in an
int, a primitive integer array. This leads to unboxing and a
null reference will break your code.
A position of
null (not zero
0) also isn't making any sense in the context of your class.
int instead of
Integer unless you actually need
Other classes inside the same package as your class typically don't need access to your internal array. Make that array
3. Think about what you want to store in your stack.
Currently your stack only allows storing primitive
ints. Maybe think about storing any type of data using generics. Extending your current class wouldn't be difficult.
Other than that: Your code is concise, not too complicated and serves its purpose. Think about formatting the code using your IDE's formatter and add comments and documentation to your code.