Programmed using Java