Code example for Hashtable

Methods: getput

        // Test for method java.util.Hashtable(int) 
        Hashtable h = new Hashtable(9);
        assertEquals("Created incorrect hashtable", 0, h.size());
        Hashtable empty = new Hashtable(0);
        assertNull("Empty hashtable access", empty.get("nothing"));
        empty.put("something", "here");
        assertTrue("cannot get element", empty.get("something") == "here");
        try { 
            new Hashtable(-1);
            fail("IllegalArgumentException expected");
        } catch (IllegalArgumentException e) {
     * java.util.Hashtable#Hashtable(int, float) 
Connect your IDE to all the code out there  Get Codota for Java