Skip to content

Instantly share code, notes, and snippets.

@sourabhrai235
Created August 25, 2020 14:48
Object obj1 = new Object();
Object obj2 = new Object();
boolean result = (obj1 == obj2);
System.out.println("Comparing two objects using == operator: " + result);
result = obj1.equals(obj2);
System.out.println("Comparing two objects using equals method: " + result);
obj1 = obj2;
result = (educationLoan == constructionLoan);
System.out.println("Comparing two references pointing on same object using == operator: " + result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment