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