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 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 :: multithreading in java 
Java :: Alerter for java 
Java :: getter in java 
Java :: binary search algorithm java 
Java :: parameterized constructor java 
Java :: uml to java 
Java :: how to sort a list in java 
Java :: syntax of the switch statement in Java 
Java :: round to the next multiple of 5 
Java :: set decimal point in java 
Java :: get string size 
Java :: nth fibonacci number java using for loop 
Java :: switch statement in java 
Java :: how to get a set from a map in java 
Java :: array in java 
Java :: Java char Keyword 
Java :: try catch block 
Java :: Split string into a string array 
Java :: buy and sell stock 
Java :: junit dependency 
Java :: javafx combobox cell 
Java :: convert code from kotlin to java 
Java :: edit text on 2sec change andropid 
Java :: convert kotlin code to java online 
Java :: access db in fragments 
Java :: how to open material navigation view on button click 
Java :: thread dump 
Java :: Betrag absolute abs java 
Java :: Algorithms - filtering 
Java :: java mongodb document get 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =