Question d’entretien chez Maventic

A java program was given to solve.