Tagged articles

string

210 articles · Page 3 of 3
Java Captain
Java Captain
Jan 20, 2018 · Fundamentals

Understanding Java String Immutability and Assignment

This article explains how Java strings are defined, how assigning one string variable to another copies the reference, how concatenation creates a new immutable string object, and why mutable alternatives like StringBuilder should be used to avoid excessive garbage collection.

Immutabilityfundamentalsjava
0 likes · 2 min read
Understanding Java String Immutability and Assignment
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.

AutoboxingIntegerObject Comparison
0 likes · 7 min read
Understanding Integer and String Comparison in Java
Java Captain
Java Captain
Nov 29, 2017 · Fundamentals

What Is an Immutable Object in Java? Understanding String Immutability

This article explains the concept of immutable objects in Java, using String as a case study, clarifies the difference between object references and objects, examines String’s internal fields across JDK versions, demonstrates how typical mutating methods actually create new instances, and shows how reflection can bypass immutability.

Immutable ObjectProgramming Fundamentalsreference
0 likes · 9 min read
What Is an Immutable Object in Java? Understanding String Immutability
Java Captain
Java Captain
Nov 11, 2017 · Fundamentals

Understanding Java's equals() and hashCode() Methods and How to Override Them

This article explains the default implementations of Java's Object.equals() and Object.hashCode(), the required contracts for overriding them, demonstrates their behavior in the String class, and provides practical guidelines and example code for correctly overriding these methods in custom classes.

@OverrideHashingObject
0 likes · 11 min read
Understanding Java's equals() and hashCode() Methods and How to Override Them
Qunar Tech Salon
Qunar Tech Salon
Mar 20, 2016 · Fundamentals

Converting Primitive Types to String and Efficient String Concatenation in Java

This article explains how to convert primitive types to strings in Java, discusses why simple concatenation with an empty string is inefficient, compares different splitting implementations, benchmarks various string concatenation methods including String.concat, the '+' operator, and StringBuilder, and recommends using String.valueOf and the OptimizeStringConcat JVM option for better performance.

String.concatStringBuilderstring
0 likes · 10 min read
Converting Primitive Types to String and Efficient String Concatenation in Java
Qunar Tech Salon
Qunar Tech Salon
Mar 30, 2015 · Backend Development

Lesser‑Known but Practical Features of Google Guava

This article explores several under‑used yet useful Google Guava utilities—including unsigned primitive types, 128‑bit MurmurHash, InternetDomainName parsing, class‑path reflection, and CharMatcher string handling—providing code examples and explanations of how they can improve Java development efficiency.

Hashingdomainreflection
0 likes · 9 min read
Lesser‑Known but Practical Features of Google Guava