Java Collection Framework Question and Answers

9. What does hashCode() method?
 
  • The hashCode() method returns a hash code value (an integer number).
  • The hashCode() method returns the same integer number. If two keys (by calling equals() method) are same.
  • But, it is possible that two hash code numbers can have different or same keys.
 
Your Name Your Email-ID
Your Answer
10. What is hash collision in hash table and how it is handled in Java?
 
  • Two different keys with the same hash value is known as hash collision.
  • Two different entries will be kept in a single hash bucket to avoid the collision.
 
Your Name Your Email-ID
Your Answer
11. How will you load a specific locale?
  By ResourceBundle.getBundle() method.
 
Your Name Your Email-ID
Your Answer
12. Which package is used for pattern matching with regular expressions?
  java.util.regex package is used for this purpose.
 
Your Name Your Email-ID
Your Answer
1234 Page 3 of 4