Tagged articles
Integer
17 articles · Page 1 of 1
The article explains that Java's Integer caching makes 1000 == 1000 false while 100 == 100 true, detailing how the IntegerCache works, why == compares references, and how reflection can expose the private cache array.
CachingIntegerJava
0 likes · 3 min read

This article explains the seven key differences between Java's primitive int and its wrapper Integer, covering default values, memory layout, comparison pitfalls, caching, autoboxing/unboxing, performance impact, and appropriate usage scenarios with concrete code examples and benchmarks.
AutoboxingIntegerJava
0 likes · 22 min read

This article explains Java's primitive data types—including integer, floating‑point, character, and boolean types—covers their memory sizes, value ranges, literal syntax, automatic and explicit type conversions, and provides concrete code examples and tables for reference.
IntegerJavaType Conversion
0 likes · 16 min read

This article explains the differences between replace and replaceAll, how Integer caching affects equality checks, why constructing BigDecimal with double can cause precision loss, the nuances of string concatenation, the distinction between isEmpty and isBlank, when to check for null in MyBatis mapper results, and the correct way to use indexOf in Java.
IntegerStringbigdecimal
0 likes · 13 min read


ITPUBDec 22, 2024 · Fundamentals
This article explains why using the == operator on two Integer objects in Java can yield true for some values and false for others, covering Integer caching, the role of Integer.valueOf, and the correct way to compare Integer values with equals.
IntegerJavaObject Comparison
0 likes · 7 min read


ITPUBOct 13, 2024 · Backend Development
This article explains why the == operator yields false when comparing two Integer objects with the value 1000 but true for the value 100, covering Java's reference comparison, the IntegerCache mechanism, its performance rationale, and a reflective hack that can even make 2+2 equal 5.
IntegerJavaReference Equality
0 likes · 7 min read

This article explains how PHP's built‑in intval() function converts different variable types—including strings, floating‑point numbers, and values in other bases—into integers, illustrating usage with code examples and noting that failed conversions return zero.
BackendIntegerPHP
0 likes · 4 min read

This article explains why using the == operator on two Java Integer objects can yield true for values between -128 and 127 but false for larger numbers, detailing the Integer cache mechanism, reference vs value comparison, and the proper use of equals for value equality.
IntegerJavaObject Comparison
0 likes · 6 min read

The article explains why storing IPv4 addresses as VARCHAR is suboptimal, demonstrates that a 32‑bit unsigned INT perfectly fits an IPv4 address, compares storage size and query performance, and shows how to use MySQL's inet_aton and inet_ntoa conversion functions.
IP addressIntegerMySQL
0 likes · 6 min read

This article examines why Java's synchronized keyword can become ineffective when locking on an Integer object, explores how autoboxing and Integer caching cause lock objects to change, and presents reliable alternatives such as class‑level locks or explicit lock maps for safe multithreaded programming.
ConcurrencyIntegerMultithreading
0 likes · 18 min read

The article explains that Java's Integer caching for values between -128 and 127 causes small integer objects to be shared, making == true for 100, whereas larger integers like 1000 are distinct objects, so == returns false, and it demonstrates this behavior with code and reflection examples.
AutoboxingIntegerJava
0 likes · 4 min read

The article explains that Java's Integer objects use an internal cache for values between -128 and 127, causing equality checks with the == operator to return true for small numbers like 100 but false for larger numbers like 1000, and demonstrates how to inspect and manipulate this cache via reflection.
AutoboxingCachingInteger
0 likes · 5 min read

This article explains the JVM storage mechanisms for primitive and wrapper types, the Integer cache range, autoboxing/unboxing behavior, and why certain Integer comparisons using ‘==’ return true or false, providing code examples and detailed analysis.
AutoboxingIntegerJVM
0 likes · 12 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

This article explains Java's Integer and String comparison quirks, detailing how autoboxing caches values between -128 and 127, why '==' behaves differently for objects versus primitives, and demonstrates these concepts with clear code examples and explanations.
AutoboxingCachingInteger
0 likes · 7 min read


21CTOJul 12, 2017 · Fundamentals
An in‑depth look at a famous Java interview puzzle reveals how the compiler injects valueOf calls, how the Integer class caches values via an internal IntegerCache, and why numbers between –128 and 127 are reused, providing essential insight for developers preparing for technical interviews.
CachingIntegerInterview
0 likes · 3 min read

Running simple Integer comparisons in Java reveals that values between -128 and 127 are cached, making identical literals share the same object, while larger numbers are distinct, and the article explains the underlying IntegerCache mechanism, its source code, and how reflection can alter it.
IntegerJavaReference Equality
0 likes · 4 min read
