Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions compare.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
public class ObjectComparisonExample
{
public static void main(String[] args)
{
//creating constructor of the Double class
Double x = new Double(123.45555);
//creating constructor of the Long class
Long y = new Long(9887544);
//invoking the equals() method
System.out.println("Objects are not equal, hence it returns " + x.equals(y));
System.out.println("Objects are equal, hence it returns " + x.equals(123.45555));
}
}