What is Hash Code in Java?

Answers were Sorted based on User's Feedback



What is Hash Code in Java?..

Answer / guest

In Java, object is associated with hash code. Hash Code is a
signed number that identifies the object.

Is This Answer Correct ?    39 Yes 6 No

What is Hash Code in Java?..

Answer / sheetal sikarwar

hash code is integer value that is return by JVM. when we
compare object by equals() method then this will return
hash code value of object. if this value is same that means
object's memory location is same. that meand object is same.
when we are saving object in HashSet, HashMap and HashTable
then this object will save by Dictonary class. this
Dictonary class is Abstact class that save object with hash
code value.

Is This Answer Correct ?    7 Yes 1 No

What is Hash Code in Java?..

Answer / srikanth

HashCode is an integer value which refers the memory location of the Object.if there is any need to compare two objects it will done by the memorylocation of that object.

Is This Answer Correct ?    0 Yes 0 No

What is Hash Code in Java?..

Answer / yeswanth reddy

public class eng {

public static void main(String[] args) throws Exception {
int i=10;
//byte[] b;
System.out.write("yeswanth".getBytes());
System.out.write(i);

String s1="shiva";

System.out.println(s1.hashCode());

}



}

Is This Answer Correct ?    0 Yes 1 No

What is Hash Code in Java?..

Answer / siva thimmannagari

everyone knows that,the objects in the HASHMAP will be
stored in the form of Key,Value pair..

Here key is the hashcode

String s1="shiva";

if u want to know the hashcode for s1--simply type
s1.hashcode();this will give the hashcode which will be
used as a KEY

Is This Answer Correct ?    7 Yes 13 No

What is Hash Code in Java?..

Answer / manikandan [ gtec,vellore ]

hash code is unique for each and every object.this like a
index or a address to identify a object.

Is This Answer Correct ?    15 Yes 24 No

Post New Answer

More Core Java Interview Questions

What is set string?

0 Answers  


What are the three types of design patterns?

0 Answers  


abstract class Demo { public void show() { System.out.println("Hello I am In show method of Abstract class"); } } class Sample extends Demo { public void show() { super.show(); System.out.println("Hello I am In Sample "); } } public class Test { public static void main(String[] args) { //I WANT TO CALL THE METHOD OF BASE CLASS IT IS POSSIBLE OR NOT CAN WE USE SCOPE RESOLUTION OPERATOR TO CALL OR JAVA NOT SUPPORTED THAT :: OPERATORE } }

3 Answers  


What are new features introduced with java 8 ?

0 Answers  


There are three interfaces A,B & C. A extends B, B extends C, and C extends A.Is it multiple Inheritance? please anybody help me.....

5 Answers  






Which containers may have a MenuBar?

1 Answers  


Can main() method in java can return any data?

0 Answers  


How many bytes is a char in java?

0 Answers  


How will you measure that int takes up only 32 bits in memory?

2 Answers   Rolta,


What is default switch case? Give example.

0 Answers  


What is an example of procedure?

0 Answers  


How can you avoid serialization in child class if the base class is implementing the serializable interface?

0 Answers  


Categories