Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java remove map key

/*Suppose a map*/
Map<T> map = new HashMap<>();
/*Insert 2 keys, and remove one*/
map.put('First', 'John');
map.put('Second', 'Tommy');
// Returns a value, you don't have to save it if you want
String removedValue = map.remove('First');
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #java #remove #map #key
ADD COMMENT
Topic
Name
5+7 =