What is the return type of the hashCode() method in the Object class?
- Object
- int
- long
- void
Answer
b. int
Explanation:
Answer: (b) int
Explanation: In Java, the return type of hashCode() method is an integer, as it returns a hash code value for the object.
Hence, the correct answer is an option (b).
Comments
Post a Comment