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

Design and implement an application that reads a sequence of up to 25 pairs of names and postal (ZIP) codes for individuals. Store the data in an object designed to store a first n


What is image processing? It field of computer whereas we enhance and manipulate the graphics. Like it is used to recover old photograph and through processing we can revive

Suppose we have a big project. Draw hierarchy of the people involved in the project? Executive Team CEO, COO, CMSO Quality Architecture Team Business Development Team Technolog

What is Bullseye explain with an example? This is a easy applet that draws a series of filled, concentric circles alternating red and white, instead a bullseye. import java.ap

Give a example of Using toString() Methods ? Below is a version of CarTest in which uses toString() and System.out.println() instead of printing the fields in a straight line

hi there I have some problem on java .. can u do it for me

WHY WE USE JAVA IN PROGRAMMING INSTEAD OF OTHER PROGRAMMING LANGUAGE

Spring framework The Spring framework is the leading full-stack J2EE /JAVA application framework. Not like other applications, Spring does not expose itself on the design of a