Hash Set class and kuch methods
package com.company;
import java.util.HashSet;
public class CWH_95_Set {
public static void main(String[] args) {
HashSet<Integer> h= new HashSet<>(7,8);
h.add(4);
h.add(41);
h.add(91);
h.add(1);
h.add(41);
h.remove(41);
for (int e:h)
{
System.out.println(e);
}
System.out.println(h.size());
}
}
Comments
Post a Comment