User defined key class in the hashtables aur hashmap, JAVA Programming

You should override the hashCode() and equals() functions from the Object class. The default implementation of the hashcode() and equals(), which are inherited from the java.lang.Object needs an object instance's memory location. That can cause serious problems when two instances of the car objects have the similar color but the inherited equals() can give false because it uses the memory location, which is distinct for the two instances of object. Also the toString() method may be overridden to give a proper string representation of your object.

 

879_Untitled.png

Posted Date: 7/25/2012 2:02:12 AM | Location : United States







Related Discussions:- User defined key class in the hashtables aur hashmap, Assignment Help, Ask Question on User defined key class in the hashtables aur hashmap, Get Answer, Expert's Help, User defined key class in the hashtables aur hashmap Discussions

Write discussion on User defined key class in the hashtables aur hashmap
Your posts are moderated
Related Questions
Need to develop a Small Android App using Text to speech and Speech to Text feature. Project Description: When the Android App Opens, It will connect to Windows Azure cloud,

what is arrays and how do they operate

Need software to print bills on A4 paper in the format provided. The details are shown below - 1. Serially generated Invoice Number. 2. Appropriate fields in the invoice have

What does the keyword " synchronize " mean in java. What are the usage and disadvantages of synchronization?

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Explain Arithmetic Promotion and Binary Operations? An int divided through an int is an int, and a double divided by a double is a double, but what about an int divided by a do

The clustering regulates high scalability and availability. The basic considerations for servlet clustering are: 1. Objects opened in a session could be serializable to support

please help please help please help please help please help please helpplease help please help

Modify your UserProfile class to meet the following requirements: It must include a field called wall to store an ArrayList of wall posting objects. It must also provide

What is difference among LookupDispatchAction and DispatchAction? Ans) The difference among LookupDispatchAction and DispatchAction is that the actual method that gets known in