Online Java Compiler By
JavaTpoint.com
public class ShortHashCodeExample4 { public static void main(String[] args) { short sValue= -1500; //with Negative value //it returns hash code value int hashValue=Short.hashCode(sValue); System.out.println(" Short ' "+sValue+" ' value converted into hash code is = " + hashValue); } }
Output