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
How can we involve images within a web page using HTML and Java script? Images can be included in HTML through employing tag, below is the format of

implementation of DT in netbeans


#queThis assignment will give you practice with defining classes. You are to write a set of classes that define the behavior of certain animals. You will be given a program that r

1. The purpose of this problem is to practice using generics.  Create a generic class with a type parameter that simulates drawing an item at random out of a box. For exampl

Session Bean : is a non-persistent object that provides some business logic running on the server. Session beans do not provide system break down. There are two kinds of session b

Describe Unbalanced Arrays ? Such as C Java does not have true multidimensional arrays. Java fakes multidimensional arrays by using arrays of arrays. This means that it is prob

palindrome is starting that reads both the ends.using string covert into character

No, java is not fully object oriented language due to it does not support "multiple inheritance" and "pointers" which are used in C++. But, by using Interfaces we can execute multi

What is object oriented programming language? In classic, procedural programming you try to form the real world problem you're attempting to solve fit a few, predetermined data