JavaGian java tutorial and java interview question and answer

JavaGian , Free Online Tutorials, JavaGian provides tutorials and interview questions of all technology like java tutorial, android, java frameworks, javascript, ajax, core java, sql, python, php, c language etc. for beginners and professionals.

How to remove duplicates from ArrayList in java

There are many ways to do it. Some of them are:
  • Using iterative approach
  • Using HashSet (but does not maintain insertion order)
  • Using LinkedHashMap

Program:

When you run above program, you will get following output:

.