Implemented the method hashCode().