Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Removing Elements in java map

// Java program to demonstrate
// the working of Map interface

import java.util.*;
class Main {

	public static void main(String args[])
	{

		// Initialization of a Map
		// using Generics
		Map<Integer, String> hashmap1= new HashMap<Integer, String>();
		
		// Inserting the Elements
		hashmap1.put(1, "Apple");
		hashmap1.put(2, "Banana");
		hashmap1.put(3, "Mango");

		// Initial Map
		System.out.println("Initial Map :"+hashmap1+"
");

		hashmap1.remove(new Integer(2));

		// Final Map
		System.out.println("Updated Map :"+hashmap1);
	}
}
Comment

PREVIOUS NEXT
Code Example
Java :: get selected text in java 
Java :: Meeting time: Merging Ranges (return) 
Java :: OpenCV mat to float bytebuffer java 
Java :: what does this means error: cannot find symbol StorageRef.child(mUser()).putFile(imageUri).addOnCompleteListener(new OnCompleteListener<UploadTask.TaskSnapshot() 
Java :: how to secure specific url in spring security 
Java :: java cors issue 
Java :: How to set the java.library.path from Eclipse 
Java :: URI/BEE problem no-1101 solution in Java 
Java :: spigot check if inventory is empty 
Java :: set countdown timer to play audio file android studio 
Java :: intent for youtube android stackoveroverflow 
Java :: JAXRS EXCEPTION MAPPER 
Java :: how to divide coloumns in a text file into seperate arrays in java 
Java :: how to send images to storage using Admin Sdk in java 
Java :: java unfocus 
Java :: Java program pattern program to triangle using 100 numbers 
Java :: class generique java 
Java :: cancel javafx stage exit request 
Java :: java get first node in a list 
Java :: comparable interface 
Java :: java consonant regex 
Java :: how to make edittext not editable in android studio 
Java :: fill a 2d array java 
Java :: spring security not going to logout success urk 
Java :: binomial heap implementation java 
Java :: 111111000 
Java :: quick select method for kth smallest element in java 
Java :: all loops in java 
Java :: read java reader 
Java :: Reason: Failed to load driver class com.mysql.cj.jdbc.Driver in either of HikariConfig class loader or Thread context classloader 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =