Source Code : Get Set view of Keys from Java LinkedHashMap
Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com.
Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com.
Click Here or search from google with Libraries Name you get jar file related it
Get Set view of Keys from Java LinkedHashMap
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Set;
public class Main {
public static void main(String[] args) {
LinkedHashMap<String,String> lHashMap = new LinkedHashMap<String,String>();
lHashMap.put("1", "One");
lHashMap.put("2", "Two");
lHashMap.put("3", "Three");
Set st = lHashMap.keySet();
Iterator itr = st.iterator();
while (itr.hasNext()){
System.out.println(itr.next());
}
st.remove("2");
boolean blnExists = lHashMap.containsKey("2");
System.out.println(blnExists);
}
}
/*
1
2
3
false
*/
Thank with us