Made the code java correct.