corejava1

1. What is 'Tiger' in java?

 No need to worry, it's just regarding version names given
J2SE 5.0 (1.5.0) --> Tiger
you can check other version names also.

2. Default size of Hashmap,Hashtable,Arraylist & Hashset?


Hashmap = 16
Hashtable = 11
Arraylist = 10
Hashset = 16

3. How to change load factor?

We have overloaded constructors for this.
For example,- to change load factor of Hashmap
use Hashmap<Key,Value>(initial capacity,load factor)
and pass values

4. How Size increment is done for ArrayList and vector?

for ArrayList ==> 50% after load factor
for vector ==> double size after load factor

5. How to traverse List in both direction?

Use ListIterator having methods:-
addFirst(),addLast()
removeFirst(),removeLast()
getFirst(),getLast()

No comments:

Post a Comment