Tag

Integer

0 views collected around this technical thread.

Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Jan 10, 2025 · Backend Development

Java String Tricks: replace vs replaceAll, Integer Caching, BigDecimal Precision

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.

BigDecimalIntegerSpring Boot
0 likes · 13 min read
Java String Tricks: replace vs replaceAll, Integer Caching, BigDecimal Precision
php中文网 Courses
php中文网 Courses
May 24, 2024 · Backend Development

Using PHP intval() to Convert Variables to Integers

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.

IntegerPHPType Conversion
0 likes · 4 min read
Using PHP intval() to Convert Variables to Integers
IT Services Circle
IT Services Circle
May 29, 2023 · Databases

Storing IPv4 Addresses in MySQL: Choosing the Optimal Data Type

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
Storing IPv4 Addresses in MySQL: Choosing the Optimal Data Type
IT Xianyu
IT Xianyu
Jan 24, 2022 · Fundamentals

Why does Java evaluate 1000==1000 as false while 100==100 evaluates to true?

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.

CachingIntegerReferenceEquality
0 likes · 4 min read
Why does Java evaluate 1000==1000 as false while 100==100 evaluates to true?
Top Architect
Top Architect
Jan 2, 2022 · Backend Development

Understanding Java Integer Caching: Why 1000 == 1000 Is False but 100 == 100 Is True

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.

CachingIntegerReference Equality
0 likes · 5 min read
Understanding Java Integer Caching: Why 1000 == 1000 Is False but 100 == 100 Is True
Java Captain
Java Captain
Dec 12, 2017 · Fundamentals

Understanding Integer and String Comparison in Java

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.

CachingIntegerObject Comparison
0 likes · 7 min read
Understanding Integer and String Comparison in Java