Online Java Compiler By
JavaTpoint.com
import java.util.ArrayList; import java.util.List; public class JavaColHashCodeExample2 { public static void main(String[] args) { List
list = new ArrayList<>(); list.add("Reema"); list.add("Rahul"); //returns the hash code for the string int val=list.hashCode(); System.out.println("Hash Code : "+val); } }
Output