The syntax of List.hashCode property is:
int hashCode
This hashCode property of List the hash code for this object.
List.hashCode returns value of type int
.
In this example,
'Hello'
.hashCode
property to get its hash code.void main() {
int hashCodeValue = 'Hello'.hashCode;
print(hashCodeValue);
}
180399535
In this example,
123
.hashCode
property to get its hash code.void main() {
int hashCodeValue = 123.hashCode;
print(hashCodeValue);
}
123
In this example,
true
.hashCode
property to get its hash code.void main() {
int hashCodeValue = true.hashCode;
print(hashCodeValue);
}
519018
In this Dart tutorial, we learned about hashCode property of List: the syntax and few working examples with output and detailed explanation for each example.