Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what happens when we add the objects morethan the size limit
to a hashmap

Answer Posted / kanu butani

When the number of entries in the hash table exceeds the
product of the load factor and the current capacity, the
hash table is rehashed (that is, internal data structures
are rebuilt) so that the hash table has approximately twice
the number of buckets.
As a general rule, the default load factor (.75) offers a
good tradeoff between time and space costs. Higher values
decrease the space overhead but increase the lookup cost
(reflected in most of the operations of the HashMap class,
including get and put). The expected number of entries in
the map and its load factor should be taken into account
when setting its initial capacity, so as to minimize the
number of rehash operations. If the initial capacity is
greater than the maximum number of entries divided by the
load factor, no rehash operations will ever occur.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between inheritance and encapsulation?

1155


Is {a, n, d} a palindrome? If you are given a random string, is it a palindrome or not?

1135


What classes of exceptions may be caught by a catch clause in java programming?

1183


How does hashset work in java?

1129


What modifiers may be used with a top-level class?

1069


What is a class reference?

1111


Can inner class extend any class?

1061


Difference between process and thread?

1042


When can you say a graph to be a tree?

1087


Are arrays static in java?

1065


Explain about field hiding in java?

951


How many functional interfaces does java 8 have?

1034


What about main() method in java ?

1029


What class allows you to read objects directly from a stream in java programming?

1082


What occurs when an object is constructed?

1010