what happens when we add the objects morethan the size limit
to a hashmap
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 |
What is array sorting in java?
When throws keyword is used?
What is final modifier?
when should you use stringbuilder class in a program?
Is an object null?
3) Suppose you are a very rich person, having 50 rooms and you have lost the key for one of the room's. How effectively you can find this key? (Qs2 and Qs3 are related)
Explain method overloading and overriding?
Can we have 2 main methods in java class?
Can singleton class be serialized?
How do you sing an Applet ?
What are the steps involved to write rmi based programs?
What are advantages of using Java?s layout managers than windowing systems?