Remove value from Java LinkedHashMap in Java
Description
The following code shows how to remove value from Java LinkedHashMap.
Example
/*from w w w . j a v a2 s . c om*/
import java.util.LinkedHashMap;
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");
Object obj = lHashMap.remove("2");
System.out.println(obj + " was Removed");
}
}
The code above generates the following result.