util.HashSet; // Class class GFG { // Main driver method public static void main(String[] args) { // Creating an object of HashSet (of Integer type) HashSet<Integer> gfg = new HashSet<Integer>(); // Adding elements in above object of HashSet // Custom inputs gfg.add(24); ...
util.*; // Main class public class GFG { // Main driver method public static void main(String args[]) { // Creating an empty HashSet // Declaring object of integer type HashSet<Integer> set = new HashSet<Integer>(); // Adding custom input elements into the Set // using add() ...