8:47 pm - Thursday April 25, 2019

Tag Archives: hashset java tutorial hashset example c#

Java Program to Find maxmimum element of HashSet

import java.util.HashSet; import java.util.Collections; class FindMaximumOfHashSet{ public static void main(String[] args) { //creating Hashset Object HashSet hashSet = new HashSet(); hashSet.add(new Long("923740927")); hashSet.add(new...

Java Program to Remove all elements from HashSet

import java.util.HashSet; class RemoveAllElementsFromHashSet { public static void main(String[] args) { // creating HashSet Object HashSet hSet = new HashSet(); hSet.add(new Integer("1")); hSet.add(new Integer("2")); hSet.add(new...

Java Program to remove specified element from HashSet

import java.util.HashSet; class RemoveSpecifiedElementFromHashSet { public static void main(String[] args) { // creating HashSet Object HashSet hSet = new HashSet(); hSet.add(new Integer("1")); hSet.add(new Integer("2")); hSet.add(new...

Java program using Hash set

import java.util.HashSet; class Collections { public static void main(String[] args) { // creating HashSet Object HashSet hSet = new HashSet(); // add() method is used to insert the elements ito the set hSet.add(new Integer("1")); hSet.add(new...