Opening Hours :7AM to 9PM
HashMap<wrapperclass1,wrapperclass2> objref=new HashMap<wrapperclass1,wrapperclass2>(); wrapperclass1 is key wrapperclass2 is value
import java.util.*; class HashMapPut { void list() { HashMap<Integer,String> al=new HashMap<Integer,String>(); al.put(1,"chennai"); al.put(2,"Delhi"); al.put(3,"Ap"); al.put(4,"Tg"); System.out.println("The List Items Are "+al); } } class MAin { public static void main(String aargs[]) { HashMapPut d=new HashMapPut(); d.list(); } }
import java.util.*; class HashMapGet { void list() { HashMap<Integer,String> al=new HashMap<Integer,String>(); al.put(1,"chennai"); al.put(2,"Delhi"); al.put(3,"Ap"); al.put(4,"Tg"); System.out.println("The List Items Are "+al); System.out.println(al.get(2)); } } class Main { public static void main(String aargs[]) { HashMapGet d=new HashMapGet(); d.list(); } }
import java.util.*; class HashMapIsEmpty { void list() { HashMap<Integer,String> al=new HashMap<Integer,String>(); al.put(1,"chennai"); al.put(2,"Delhi"); al.put(3,"Ap"); al.put(4,"Tg"); System.out.println("The List Items Are "+al); System.out.println(al.isEmpty()); } } class Main { public static void main(String aargs[]) { HashMapIsEmpty d=new HashMapIsEmpty(); d.list(); } }
import java.util.*; class HashMapIsRemove { void list() { HashMap<Integer,String> al=new HashMap<Integer,String>(); al.put(1,"chennai"); al.put(2,"Delhi"); al.put(3,"Ap"); al.put(4,"Tg"); System.out.println("The List Items Are "+al); System.out.println("The Removing Element is "+al.remove(4)); } } class Main { public static void main(String aargs[]) { HashMapIsRemove d=new HashMapIsRemove(); d.list(); } }
import java.util.*; class HashMapSize { void list() { HashMap<Integer,String> al=new HashMap<Integer,String>(); al.put(1,"chennai"); al.put(2,"Delhi"); al.put(3,"Ap"); al.put(4,"Tg"); System.out.println("The List Items Are "+al); System.out.println(al.size()); } } class Main { public static void main(String aargs[]) { HashMapSize d=new HashMapSize(); d.list(); } }
import java.util.*; class HashMapKeySet { void list() { HashMap<Integer,String> al=new HashMap<Integer,String>(); al.put(1,"chennai"); al.put(2,"Delhi"); al.put(3,"Ap"); al.put(4,"Tg"); System.out.println("The List Items Are "+al); System.out.println(al.keySet()); } } class Main { public static void main(String aargs[]) { HashMapKeySet d=new HashMapKeySet(); d.list(); } }
import java.util.*; class HashMapValue { void list() { HashMap<Integer,String> al=new HashMap<Integer,String>(); al.put(1,"chennai"); al.put(2,"Delhi"); al.put(3,"Ap"); al.put(4,"Tg"); System.out.println("The List Items Are "+al); System.out.println(al.values()); } } class Main { public static void main(String aargs[]) { HashMapValue d=new HashMapValue(); d.list(); } }
import java.util.*; class HashMapClear { void list() { HashMap<Integer,String> al=new HashMap<Integer,String>(); al.put(1,"chennai"); al.put(2,"Delhi"); al.put(3,"Ap"); al.put(4,"Tg"); System.out.println("The List Items Are "+al); al.clear(); System.out.println(al); } } class Main { public static void main(String aargs[]) { HashMapClear d=new HashMapClear(); d.list(); } }
import java.util.*; class HashMapContainsKey { void list() { HashMap<Integer,String> al=new HashMap<Integer,String>(); al.put(1,"chennai"); al.put(2,"Delhi"); al.put(3,"Ap"); al.put(4,"Tg"); System.out.println("The List Items Are "+al); System.out.println(al.containsKey(2)); } } class Main { public static void main(String aargs[]) { HashMapContainsKey d=new HashMapContainsKey(); d.list(); } }
import java.util.*; class HashMapContainsValue { void list() { HashMap<Integer,String> al=new HashMap<Integer,String>(); al.put(1,"chennai"); al.put(2,"Delhi"); al.put(3,"Ap"); al.put(4,"Tg"); System.out.println("The List Items Are "+al); System.out.println(al.containsValue("chennai")); } } class Main { public static void main(String aargs[]) { HashMapContainsValue d=new HashMapContainsValue(); d.list(); } }
import java.util.*; class HashMapPutAll { void list() { HashMap<Integer,String> al=new HashMap<Integer,String>(); al.put(1,"chennai"); al.put(2,"Delhi"); al.put(3,"Ap"); al.put(4,"Tg"); System.out.println("The List Items Are "+al); HashMap<Integer,String> al2=new HashMap<Integer,String>(); al2.putAll(al); System.out.println(al2); } } class Main { public static void main(String aargs[]) { HashMapPutAll d=new HashMapPutAll(); d.list(); } }
import java.util.*; class HashMapClone { void list() { HashMap<Integer,String> al=new HashMap<Integer,String>(); al.put(1,"chennai"); al.put(2,"Delhi"); al.put(3,"Ap"); al.put(4,"Tg"); System.out.println("The List Items Are "+al); HashMap<Integer,String> al2; al2=(HashMap)al.clone(); System.out.println(al2); } } class Main { public static void main(String aargs[]) { HashMapClone d=new HashMapClone(); d.list(); } }