Implement a stack using an array, including push, pop and peek methods. Code in Java, JavaScript and Python.