Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.HashSet;

public class Main {

    public static void main(String[] args) {
        HashSet<Integer> hSet = new HashSet<Integer>();

        hSet.add(new Integer("1"));
        hSet.add(new Integer("2"));
        hSet.add(new Integer("3"));

        System.out.println(hSet);

        boolean blnRemoved = hSet.remove(new Integer("2"));

        System.out.println(blnRemoved);

        System.out.println(hSet);

    }

}
/*
[1, 2, 3]
true
[1, 3]
*/