WHY IS IMPORTANT THE USAGE OF HASHCODE() AND EQUALS() IN JAVA? WHAT DOES THE INTERFACE SERIALIZABLE DOES IN JAVA

Subject Android
Institute Institute of Science and Technology, Bangladesh 2012

The usage of hashCode() and equals() is crucial when we start using HashMaps. A HashMap uses both functions to determine the index of keys and to detect duplicates. By implementing those methods in the target classes, the efficiency, and accuracy of the HashMap increases.

Serialization is the process of translating an object into binary information so it can be stored in a database or be sent through a network request without losing information. To make an object Serializable in Java, we need to implement the interface java.io.Serializable

Login to post your comment.