Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

hashset java

HashSet<Integer> set = new HashSet<>();
set.add(1);
set.add(2);

if(set.contains(1)){
  print("hashset contains 1");
}
else{
   print("hashset doesn't contain 1");
}
//output
hashset contains 1
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #hashset #java
ADD COMMENT
Topic
Name
8+3 =