String s1="BF"; //hashcode= 'B'*31+'F'
String s2="Ae"; //hashcode= 'A'*31+'e'
Both have hashcode of 2116.As hashCode() return a 32bit integer, you can guess what if there're more than 2^32 objects. Collision cannot be avoided.