/***** Code de MesExemples.com *******/ import java.util.HashSet; class VérificationHashSet { public static void main(String[] args) { // créer un objet HashSet HashSet hashSet = new HashSet(); hashSet.add(new Integer("1")); hashSet.add(new Integer("2")); hashSet.add(new Integer("3")); boolean blnExists = hashSet.contains(new Integer("3")); System.out.println("3 exist-il dans HashSet ? : " + blnExists); } } /* 3 exist-il dans HashSet ? : true */