java.util.Hashtable.rehash() Method

Advertisements


Description

The rehash() method is used to increase the capacity and internally reorganizes this hashtable.This is done to accommodate and access its entries more efficiently.This method is called automatically when the number of keys in the hashtable exceeds this hashtable's capacity.

Declaration

Following is the declaration for java.util.Hashtable.rehash() method.

protected void rehash()

Parameters

  • NA

Return Value

NA

Exception

  • NA

Example

NA

This is a protected method and called automatically when the number of keys in the hashtable exceeds this hashtable's capacity.So the stand alone application can not be used to test the method.

Let us compile and run the above program, this will produce the following result.

NA



Advertisements
Advertisements