Code example for Hashtable

Methods: get

        Map map = new TreeMap();
        Object firstVal = "Gabba";
        Object secondVal = new Integer(5);
        map.put("Gah", firstVal);
        map.put("Ooga", secondVal);
        Hashtable ht = new Hashtable(map);
        assertTrue("a) Incorrect Hashtable constructed",
                ht.get("Gah") == firstVal);
        assertTrue("b) Incorrect Hashtable constructed",
                ht.get("Ooga") == secondVal);
        try { 
            new Hashtable(null);
            fail("NullPointerException expected");
        } catch (NullPointerException e) {
Connect your IDE to all the code out there  Get Codota for Java