Aditya Prasann

Greenhorn
+ Follow
since Mar 06, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Aditya Prasann

A Hashtable internally contains buckets in which it stores the key/value pairs. The Hashtable uses the key's hashcode to determine to which bucket the key/value pair should map. When you pass a key/value to the Hashtable, it queries the key's hashcode. The Hashtable uses that code to determine the bucket in which to place the key/value. Hashcodes, however, represent only half the picture. The hashcode only tells the Hashtable into which bucket to drop the key/value. Sometimes, however, multiple objects may map to the same bucket, an event known as a collision. In case of collision it looks for the implementation of key's equals method. If two keys are 'unequal' by implementation of equals method it will store the two key/value pair at the same location. Here in your example as you are using String as keys(which are immutable), the value gets replaced as the two keys are equal.
17 years ago
Yes you can write user defined exceptions. User defined exceptions are those exceptions which an application provider or an API provider defines by subclassing java.lang.Throwable class.
18 years ago
Object do not persist across requests. Only String persist. If you want them to persist across requests, you'll need to either pass them along as hidden parameters in the page, or store them in the session (be sure to explicitly remove them when no longer needed).
18 years ago
JSP