Tagged articles

String

208 articles · Page 3 of 3
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 FundamentalsReflection
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.

StringString.concatStringBuilder
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.

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