if two references are having same hash codes,is that means
those are refering to same object?
Answers were Sorted based on User's Feedback
Answer / aparna
no.they need not b referin 2 same obj.if 2 references
pointng to same obj then also the hascode may same or maynt
same.its totally depends on JVM.
| Is This Answer Correct ? | 7 Yes | 1 No |
Answer / dheerendra
If two objects are same then on equals obj1.equals(obj2)
return true as well as the hashCode will also be same but if
the hashCode of two objects are same then it is not sure
that objects would point to same reference.
| Is This Answer Correct ? | 2 Yes | 0 No |
What are the two types of exceptions in java? Which are the differences between them?
What is difference between Heap and Stack Memory?
Explain enumeration in java?
What is a default package ?
Diff between C++ and java?
worst case complexities of Quick sort and Merge sort.
What is the purpose of abstract class?
How to read and write image from a file ?
Nullpointer exception is a very common exception. Why is it not made as a checked exception?
2) Suppose there are 5 directories having lot of files (say txt files) in each directory. 2 things :- 2.1) You want to search for filenames which have a particular pattern. 2.2) Out of these filtered files you want to search for a particular keyword or a search string. How can you achieve this?
What are different access specifiers in java?
In treeset we add same object ...what will be the out put