By \"non-empty\", I mean in this question a string which contains at least one non-zero character.
For reference, here\'s the hashCode
implementation :<
just be care of that int h;
. It may overflow, every string that satisfy h % 2^31 == 0
may lead to this.
public class HelloWorld {
public static void main(String []args) {
System.out.println("\u0001!qbygvW".hashCode());
System.out.println("9 $Ql(0".hashCode());
System.out.println(" #t(}lrl".hashCode());
System.out.println(" !!#jbw}a".hashCode());
System.out.println(" !!#jbw|||".hashCode());
System.out.println(" !!!!Se|aaJ".hashCode());
System.out.println(" !!!!\"xurlls".hashCode());
}
}
A lot of strings...