string.hashCode()
String.hashCode() Returns hash code of the input string.
Syntax
String1.hashCode(string.hashCode()
Returns an integer
Here are some examples with output.
String my_str="plus2net";
System.out.println(my_str.hashCode());// -1850174267
System.out.println("Hi".hashCode());// 2337
System.out.println("H".hashCode());// 72
System.out.println("i".hashCode());// 105
System.out.println("2".hashCode());// 50
System.out.println("welcome".hashCode());// 1233099618
System.out.println("WELCOME".hashCode());// 1951082306
« All String functions
« Java
This article is written by plus2net.com team.
plus2net.com