Java: Stack Queation

How exactly do we know about stacks, because stacks (linked stacks) allow zero values ​​to be at the top of the stack? For example, the Peek method returns null when a stack is empty. So how do we know exactly if we were up or not?