Javatpoint Logo
Javatpoint Logo

Java Short equals() Method

The equals() method of Short class is used to compare two objects for checking equality.

Syntax

Parameters

Obj: the object to compare with

Return value

True: If both object are same.

False: If both object are different.

Example1: (Both object same)

Test it Now

Output:

short Obj1 55 and short Obj2 55  are same : true 

Example 2: (Both object different)

Test it Now

Output:

short Obj1 65 and short Obj2 85  are same : false

Next TopicJava Short





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA