Tagged articles
equality
30 articles · Page 1 of 1
This guide explains the fundamental distinction between Java's == operator and the equals() method, covering primitive vs. reference comparisons, default implementations, common pitfalls like string interning and Integer caching, and the essential contract with hashCode for reliable object equality.
InterviewOperatorequality
0 likes · 7 min read

This article explains how Java handles null and empty‑string comparisons with a.equals(b), Objects.equals(a, b), and the == operator, detailing the resulting return values, exception behavior, and the underlying source code logic.
JavaNULL handlingObjects.equals
0 likes · 7 min read

While the strict equality operator (===) works well for most cases, it fails with special values like NaN and distinguishes +0 and -0 incorrectly; JavaScript’s Object.is() method provides a more precise same‑value equality, correctly handling these edge cases and improving comparisons in Maps, Sets, and other structures.
+0 -0JavaScriptNaN
0 likes · 5 min read

This article explores three Python quirks: how dictionary keys with equal numeric values overwrite each other due to hashing and equality rules, why a return statement inside a try block is superseded by a return in the finally clause, and how object identity and id values behave, including hash collisions and memory reuse.
Exception HandlingPythondictionary
0 likes · 4 min read

This article explains why top tech companies forbid the loose equality operator (==) in JavaScript, detailing its unpredictable implicit type coercion, contrasting it with strict equality (===), and showing common pitfalls and safer alternatives for robust, maintainable code.
== vs ===Strict EqualityType Coercion
0 likes · 5 min read

This article explains how Kotlin treats lambda expressions as distinct objects, causing two data class instances with identical lambda bodies to be unequal, demonstrates the problem with code examples, and shows how extracting the lambda into a shared reference restores proper equality, highlighting implications for equals, hashCode, and Compose.
Code ExampleKotlindata class
0 likes · 3 min read

Major tech firms such as Google, Airbnb, and Microsoft forbid the use of JavaScript’s == operator and advocate === because it avoids unpredictable type coercion, improves code readability and maintainability, offers better performance, reduces bugs, and enhances security, especially in critical applications.
Best PracticesJavaScriptType Coercion
0 likes · 3 min read

This article explains the surprising behavior of Python sets when mixing True, integers, floats, and how the distinction between the is operator and the == operator determines element uniqueness, while also reviewing Python's basic immutable and mutable data types.
data typesequalityis-operator
0 likes · 4 min read

This article explains how the == operator compares object values while the is operator checks object identity in Python, provides detailed usage scenarios, and includes practical code examples for basic types, composite types, None, and API testing.
comparisonequalityidentity
0 likes · 9 min read

This article explores the various ways to compare structs, slices, maps, and other Go types, explaining when the == operator is applicable, why it fails for certain types, and how alternatives like reflect.DeepEqual, cmp.Equal, and testify can be used effectively.
CMPGoStruct
0 likes · 11 min read

This article explores five of the most iconic mathematical symbols—e, π, i, 0, and =—detailing their definitions, historical origins, and profound impact across calculus, physics, engineering, computer science, and beyond, illustrating how each symbol bridges abstract theory and real‑world applications.
PiZeROe constant
0 likes · 7 min read

This article explains how Java's Objects.equals differs from the traditional a.equals(b) method, covering null and empty‑string scenarios, demonstrating safe comparisons without NullPointerExceptions, and includes a concise analysis of the underlying source code and the distinction between a==b and a.equals(b).
JavaNULL handlingObjects.equals
0 likes · 5 min read

This article examines the importance of inclusive language in game localization, defines its principles, outlines common pitfalls such as gendered and racial terms, presents practical guidelines and multilingual strategies, and argues that adopting equitable language fosters a fairer, more welcoming gaming experience for diverse players worldwide.
Gaming Industrydiversityequality
0 likes · 11 min read

This article presents five common Java String interview questions, shows the expected outputs, and explains in detail how string literals, the string pool, object creation, and concatenation affect equality comparisons and memory behavior in the JVM.
InterviewJVMMemory
0 likes · 9 min read

An in‑depth look at why Python’s Boolean type is actually a subclass of int, covering object identities, the __base__ attribute, and the distinction between the ‘is’ and ‘==’ operators, complete with code screenshots and reference links for further reading.
Type Systembooleanequality
0 likes · 4 min read

This article explains six frequent Java pitfalls—including misuse of the == operator with Integer, subtle bugs in Objects.equals, precision loss with BigDecimal constructors, reference sharing in Stream.filter, NullPointerExceptions from autounboxing, and differences between replace, replaceAll, and replaceFirst—providing code examples and best‑practice recommendations.
AutoboxingJavaStringReplace
0 likes · 12 min read

This article walks Java developers through six frequent pitfalls—including misuse of the == operator, subtle bugs in Objects.equals, precision issues with BigDecimal, unexpected Stream filter behavior, autoboxing/unboxing surprises, and string replace quirks—offering clear explanations, code examples, and best‑practice solutions to help avoid costly bugs.
AutoboxingJavaString replace
0 likes · 13 min read


政采云技术Jun 21, 2022 · Frontend Development
This article explains how to satisfy the JavaScript expression x == 1 && x == 2 && x == 3 by understanding the differences between loose (==) and strict (===) equality, type coercion rules, and implementing custom valueOf or toString methods on objects to increment a counter during each comparison.
Loose EqualityToPrimitiveType Conversion
0 likes · 9 min read

This article explains how Java's Objects.equals works, compares it with the == operator and the equals method of primitive wrappers, demonstrates typical null‑pointer and type‑mismatch pitfalls, and provides practical code examples and solutions for reliable value comparison.
JavaNullPointerExceptionObjects.equals
0 likes · 14 min read

This article examines why Java's Objects.equals may return unexpected results, explores the differences between ==, equals, and Objects.equals, highlights null‑pointer risks, and reveals common type‑mismatch pitfalls with practical code examples and solutions.
Best PracticesJavaNullPointerException
0 likes · 15 min read

This article explains why Java's Objects.equals can yield unexpected false results, compares different equality‑checking methods, shows how type mismatches and null values cause pitfalls, and provides practical code examples and solutions for safe object comparison.
JavaNullPointerExceptionObjects.equals
0 likes · 16 min read

This article explores a surprising behavior of Python sets where values like 1, 1.0, True, and even complex numbers are considered identical, explains the underlying use of the 'is' and '==' operators, and demonstrates how this affects deduplication with clear code examples.
Pandasdata typesequality
0 likes · 5 min read

This article presents five common Java String interview questions, explains the output of each code snippet, analyzes the behavior of the == operator and equals method, and illustrates memory allocation in the string constant pool and heap with diagrams and detailed explanations.
InterviewJDKJava
0 likes · 8 min read

The article walks through five common Java String interview questions, providing code snippets, execution results, and in‑depth analysis of reference equality, object creation in the constant pool, and the impact of the '+' operator, illustrated with memory diagrams to clarify each answer.
InterviewJDKJava
0 likes · 9 min read

This article explains how Objects.equals differs from a.equals when handling nulls and empty strings, analyzes the underlying source code, and clarifies the distinction between reference (a==b) and logical (a.equals(b)) comparisons in Java.
NULL handlingObjects.equalsequality
0 likes · 5 min read

This article walks through five typical Java String interview questions, providing code examples, execution results, and in‑depth explanations of reference equality, the string constant pool, object creation, and compile‑time versus runtime concatenation to help readers master Java string behavior.
InterviewMemoryString
0 likes · 8 min read

This article examines the implementation details of Python's == and is operators, showing how both are compiled to COMPARE_OP bytecode with different opcodes, exploring the underlying C functions like cmp_outcome and object_richcompare, and explaining the rich comparison protocol and its default behavior.
Pythonbytecodecomparison
0 likes · 11 min read

This article examines five common Java String interview questions, detailing why each equality check yields true or false by exploring the behavior of the == operator, the equals method, constant pool usage, object creation, and runtime concatenation, all illustrated with code and memory diagrams.
InterviewJDKJava
0 likes · 9 min read

This article explains why Java's Integer and String objects behave differently when compared with ==, covering autoboxing, the Integer cache range, string constant pool behavior, and the effects of unboxing on equality checks.
AutoboxingCachingInteger
0 likes · 7 min read


ITPUBMar 25, 2017 · Fundamentals
The article explores why mathematically equal expressions like 5×3 and 5+5+5 are not necessarily equivalent, explains the distinction between equality and equivalence, illustrates with real‑world and programming examples such as JavaScript’s == versus === and matrix multiplication rules, and discusses teaching implications.
EducationJavaScriptequality
0 likes · 6 min read
