public
int hashCode()
Returns
the hash code value for this list.
import java.util.*; class LinkedListHashCode{ public static void main(String args[]){ LinkedList<Integer> myList = new LinkedList<> (); System.out.print("Hash Code of myList is "); System.out.println(myList.hashCode()); myList.add(10); System.out.print("Hash Code of myList is "); System.out.println(myList.hashCode()); } }
Output
Hash Code of myList is 1 Hash Code of myList is 41
No comments:
Post a Comment