Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

hashtable java

import java.util.*;  
class Hashtable1{  
 public static void main(String args[]){  
  Hashtable<Integer,String> hm=new Hashtable<Integer,String>();  
  
  hm.put(100,"Amit");  
  hm.put(102,"Ravi");  
  hm.put(101,"Vijay");  
  hm.put(103,"Rahul");  
  
  for(Map.Entry m:hm.entrySet()){  
   System.out.println(m.getKey()+" "+m.getValue());  
  }  
 }  
}  
Comment

hashtable in java

- HashTable don't have null key, sychronized(thread-safe)
  Good for parallel testing
Comment

hashtable

- HashTable don't have null key, sychronized(thread-safe)
good for parallel testing
Comment

HashTable Java

//Java Hashtable
//--------------
  
import java.io.*;
import java.util.*;
  
class AddElementsToHashtable {
    public static void main(String args[])
    {
       
        Hashtable<Integer, String> h1 = new Hashtable<>();
  
        // Initialization of a Hashtable using Generics
        Hashtable<Integer, String> h2 = new Hashtable<Integer, String>();
  
        // Inserting the Elements using put() method
        //                              ------------
        ht1.put(1, "Chris");
        ht1.put(2, "Tony");
        ht1.put(3, "Peter");
        ht2.put(4, "Steven");
  
        // Print mappings to the console (Output)
        System.out.println("Mappings of Hash Table 1 : " + h1);
        System.out.println("Mappings of Hash Table 2 : " + h2);
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: java 8 seconds to days 
Java :: && java 
Java :: Build path specifies execution environment JavaSE-1.8. There are no JREs installed in the workspace that are strictly compatible with this environment. 
Java :: how to use a switch statement in java 
Java :: how to make a for loop increment by 2 in java 
Java :: how to replace a character with another character in a string in java 
Java :: rotate matrix in java 
Java :: extend vs implement in java 
Java :: how to access methods from another class in java 
Java :: java remove map key 
Java :: java jcombobox selected item changed 
Java :: Calling A Class From Another Class In Java 
Java :: create thread 
Java :: loop through array in java 
Java :: Black belt in grepper 
Java :: spring jpa query with union all 
Java :: schantalgebra 
Java :: exitonclose swing 
Sql :: magento 2 order delete from db 
Sql :: postgres get running query 
Sql :: oracle sql drop sequence 
Sql :: how to get non integer value in sql 
Sql :: cambiar nombre tabla mysql 
Sql :: sql get missing id 
Sql :: mysql group by month 
Sql :: pl sql escape & 
Sql :: mysql select random id from table 
Sql :: oracle find text in functions 
Sql :: postgres install unaccent extension 
Sql :: see all users mysql 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =