hashset size 28 29 method in java

Solutions on MaxInterview for hashset size 28 29 method in java by the best coders in the world

showing results for - "hashset size 28 29 method in java"
Emanuele
24 May 2017
1import java.util.HashSet;
2public class HashSetSizeMethodExample
3{
4   public static void main(String[] args)
5   {
6      HashSet<String> hs = new HashSet<String>();
7      hs.add("Welcome");
8      hs.add("hello");
9      hs.add("world");
10      hs.add("core");
11      hs.add("java");
12      System.out.println("HashSet values: " + hs);
13      System.out.println("The size of HashSet is: " + hs.size());
14   }
15}