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