May 16, 2025 · 3 min read · When learning Java, you’ll regular see == operator and .equals() used to compare values. They look similar, but they work very differently. In this post, we'll cover: ✅ What == really does✅ How .equals() is different✅ Use cases with int, float, Strin...
Join discussion
May 2, 2025 · 6 min read · Introduction The == operator is used to compare references, while the equals method is used to compare the contents of objects. Comparison for predefined types Primitive types The comparison operator works with predefined types, such as integers, boo...
Join discussion
Dec 18, 2023 · 2 min read · Well equals() method and == operator both do the comparison operation and give us boolean output. But the difference is how they do the comparison. == Operator: The == operator has two ways of comparing objects/data. when used with primitive data ty...
Join discussion
Nov 20, 2023 · 3 min read · Introduction equals() method: This method helps us figure out if two instances of a class are the same or not. In Apex, all classes come with a basic Object class that already has a default equals() method. This default method checks if two objects ...
Join discussion
May 7, 2023 · 2 min read · equals() is a method that compares the actual content of the object. "==" is an operator that compares the memory or reference location of an object in the heap. equals() The String equals() function compares two strings based on their data/content....
SSKV commented
Feb 3, 2023 · 2 min read · Hi Guys this is Anoop, I am starting my blogging journey with basic topics of Java.Please feel free to write your reviews. Introduction As we all know there is an Object class in Java. who is the parent of each class by default? This Object class com...
Mnikita commented