Deleting element from HashMap using built-in method remove()

 

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class HashMapRemove {

public static void main(String[] args) {
//Creating HashMap;
Map<Integer, String> hm = new HashMap<>();
//Putting element
hm.put(1, "Naidu");
hm.put(3, "Rohilla");
hm.put(5, "Vijay");
hm.put(2, "Rahul");
hm.put(4, "Ramakesh");
hm.put(6, "Sudeep");
//Storing null value
hm.put(null, null);

hm.remove(5);
System.out.println(hm);
hm.remove(6, "Sudeep");
System.out.println(hm);
//key and value doesn't match, no operation will be performed
hm.remove(4, "Rahul");
System.out.println(hm);
}
}

Google Script for Data Entry Form in Google Spreadsheet

// function to validate the entry made by user in user form function validateEntry (){ // declare a variable and referernece of active goog...