Content about Java ERP Solution for Reviews Best ERP Software for sale and Free Software with Java OpenSource for Free Download

Java hashmap get value by key example code for java hashmap

we can call method get to Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

Method syntax

public V get(Object key)

Method input parameter

    key - the key whose associated value is to be returned

Method return

the value to which the specified key is mapped, or null if this map contains no mapping for the key

Example Code for java enum valueof

        HashMap hm=new HashMap();
      hm.put("key1", "data1");
      hm.put("key2", "data2");
      String data=hm.get("key1");
      System.out.println(data);

Javascript popup window onclick example to open URL with Popup

You can open new popup windows with function window.open()  send URL and optional option  in parameter
window.open("URL" , "Target", "Option");
URL : url you want to link to
Target : _blank , _self
Option : you can customize display option eg. display toolbar ? , scrollbars ? . you can config display position and pop up size.
for example in below

Example for open url popup windows with java script
 <script>  
    // Create array of String  
    arrayObj=["CAT","DOG","MAN","CAR"];  
    for (var i=0;i<arrayObj.length;i++)  
      document.write(arrayObj[i] + "<br>");  
    }  
 </script>