Online Java Compiler By
JavaTpoint.com
public class ShortEqualsExample2 { public static void main(String[] args) { // create short object and assign value to it Short sObject1 = 65; Short sObject2 = 85; // Equals method will return False because both Object are different boolean result = sObject1.equals(sObject2); System.out.println("short Obj1 "+sObject1+" and short Obj2 "+sObject2+" are same : " + result); } }
Output