import java.util.Hashtable; import java.util.Set; public class HashTableOfObject { public static void main(String[] args) { Hashtable<Integer,User> ht = new Hashtable<Integer,User>(); ht.put(1,new
Continue readingCategory: java collection framework example
How to create HashTable In Java
import java.util.Hashtable; public class CreateHashTable { public static void main(String[] args) { Hashtable<Integer,String> ht = new Hashtable<Integer,String>(); /* * Maps
Continue readingJava Array to Set
In this tutorial we will learn about How to convert java array to Set . We will discuss how to
Continue readingJava Initialize Set
In this tutorial we will learn how to initialize set in java using various methods . We can create Set
Continue readingJava TreeSet Examples
TreeSet extends AbstractSet and implements NavigableSet interface. TreeSet is similar to HashSet except that it store element in sorted order.The
Continue readingHow to check LinkedHashSet Empty Or not
package com.javapro.vector.linkedhashset; import java.util.LinkedHashSet; import java.util.Set; public class IsEmpty { public static void main(String[] args) { Set<String> lhs = new
Continue readingHow to count number of element in LinkedHashSet
import java.util.LinkedHashSet; import java.util.Set; public class CountElement { public static void main(String[] args) { Set<String> lhs = new LinkedHashSet<String>(); lhs.add(“mumbai”);
Continue readingHow to find does LinkedHashSet contains elements or not
Returns true if this set contains the specified element. More formally, returns true if and only if this set contains
Continue readingHow To Convert LinkedHashset To Array
import java.util.LinkedHashSet; import java.util.Set; public class LinkedHashSetToArray { public static void main(String[] args) { Set<String> lhs = new LinkedHashSet<String>(); lhs.add(“mumbai”);
Continue readingHow to Remove Set From LinkedHashSet
import java.util.HashSet; import java.util.LinkedHashSet; import java.util.Set; public class RemoveAll { public static void main(String[] args) { Set<String> lhs = new
Continue reading