Question d’entretien chez Amdocs

asked to solve a Java program