devxlogo

Eliminating Duplicate Values

Eliminating Duplicate Values

To eliminate duplicate values in a collection, Java provides it own API. HashSet (java.util.*) is the class which implements Set interface.

 import java.util.*;class Duplicate{	static void main(String[]arr){		HashSet set=new HashSet();		String[]data={

devx-admin

Share the Post: