Agilysys interview question

java program to eliminate the duplicate