Tagged articles
202 articles
Page 2 of 3
Xuanwu Backend Tech Stack
Xuanwu Backend Tech Stack
Aug 3, 2022 · Fundamentals

Why Is Java String Immutable? Understanding Final, Thread Safety, and Performance

This article examines Java's String immutability, detailing how the final character array and private design prevent modification, compares mutable alternatives like StringBuilder and StringBuffer, and discusses their thread safety and performance implications to guide developers in choosing the appropriate class for different scenarios.

Stringimmutabilityjava
0 likes · 5 min read
Why Is Java String Immutable? Understanding Final, Thread Safety, and Performance
Programmer DD
Programmer DD
Apr 19, 2022 · Backend Development

Why Java 8 Switched String Storage to byte[] and How It Saves Memory

The article explains how Java 8 changed the internal representation of String from a char[] to a byte[] to reduce memory consumption, the role of Latin‑1 encoding, the impact on garbage collection, and why UTF‑16 remains the practical choice for Java strings.

Memory OptimizationStringUTF-16
0 likes · 8 min read
Why Java 8 Switched String Storage to byte[] and How It Saves Memory
FunTester
FunTester
Dec 2, 2021 · Fundamentals

Regular Expressions in Java: Theory, Syntax, and Practical Examples

This article provides a comprehensive overview of Java regular expressions, covering their historical background, core syntax such as character literals, character classes, quantifiers, anchors, and logical operators, and demonstrates practical use cases like validation, splitting, and replacement of strings.

Stringpatternregex
0 likes · 9 min read
Regular Expressions in Java: Theory, Syntax, and Practical Examples
Python Programming Learning Circle
Python Programming Learning Circle
Sep 29, 2021 · Fundamentals

Common Python Data Types and Their Usage

This article introduces Python’s fundamental data types—including integers, floats, booleans, and strings—explaining their characteristics, representation formats, common pitfalls such as floating‑point precision, and provides concise code examples illustrating each type’s usage in Python.

Stringboolfloat
0 likes · 3 min read
Common Python Data Types and Their Usage
Python Crawling & Data Mining
Python Crawling & Data Mining
Jul 8, 2021 · Fundamentals

Master 15 Essential Python String Methods with Real Code Examples

This article walks through fifteen core Python string methods—such as find, index, count, replace, split, capitalize, title, startswith, endswith, lower, upper, strip, rfind, rindex, partition, and join—explaining their syntax, showing runnable code snippets, and displaying the actual output images for each operation.

StringTutorialcode
0 likes · 9 min read
Master 15 Essential Python String Methods with Real Code Examples
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Jul 3, 2021 · Fundamentals

Comprehensive Guide to Java String: Basics, Usage, Source‑Code Analysis, and Interview Questions

This article provides an in‑depth tutorial on Java's String class, covering primitive data types, official documentation, common usage examples, detailed source‑code walkthrough of constructors and key methods, as well as typical interview questions and performance considerations for backend development.

JDKStringjava
0 likes · 32 min read
Comprehensive Guide to Java String: Basics, Usage, Source‑Code Analysis, and Interview Questions
php Courses
php Courses
Jun 30, 2021 · Backend Development

Understanding PHP's zend_string Structure and Memory Management

This article explains the internal PHP7+ data structures such as _zval_struct, zend_value, and zend_string, detailing their fields, type definitions, memory layout, flexible array usage, and the associated allocation and release macros that enable efficient, binary‑safe string handling in the Zend Engine.

BackendC languageMemory Management
0 likes · 11 min read
Understanding PHP's zend_string Structure and Memory Management
Laravel Tech Community
Laravel Tech Community
Jun 24, 2021 · Backend Development

Performance‑Optimized Alternatives to Common PHP Functions

This article presents faster PHP 7.4 alternatives for typical array and string operations—removing duplicates, picking random elements, alphanumeric checks, and substring replacement—backed by benchmark results and additional coding tips for production performance.

ArrayStringoptimization
0 likes · 6 min read
Performance‑Optimized Alternatives to Common PHP Functions
Senior Brother's Insights
Senior Brother's Insights
May 5, 2021 · Fundamentals

What Is the True Maximum Length of a Java String?

This article explores the theoretical and practical limits of Java String length, analyzing JDK source code, integer ranges, JVM constant pool constraints, and runtime memory considerations to reveal why the maximum size is 2^31‑1 characters (≈4 GB) at runtime but only 65 534 characters at compile time.

Compile-timeJVMLength Limit
0 likes · 8 min read
What Is the True Maximum Length of a Java String?
Java Backend Technology
Java Backend Technology
Mar 25, 2021 · Fundamentals

Why Is Java’s String Immutable? Uncover the JVM’s Secret

This article explains why Java String objects are immutable, how the JVM’s string constant pool reuses instances, the role of the final keyword and char[] storage, and demonstrates that all mutating operations actually create new String objects rather than altering the original.

JVMStringfinal
0 likes · 10 min read
Why Is Java’s String Immutable? Uncover the JVM’s Secret
Architect's Tech Stack
Architect's Tech Stack
Mar 11, 2021 · Fundamentals

Understanding Java String Length Limits and JVM Specification

This article explains Java's String length limitations, detailing how strings are stored as char arrays, the int‑based length method, the JVM class‑file constant pool constraints (u2 index max 65535, effectively 65534), and demonstrates practical experiments confirming these limits.

JVMLength LimitString
0 likes · 8 min read
Understanding Java String Length Limits and JVM Specification
Senior Brother's Insights
Senior Brother's Insights
Mar 8, 2021 · Fundamentals

How JDK 9’s Compact Strings Slash Java Memory Usage

The article explains how Java's String class was re‑engineered in JDK 9 to use a byte‑array with a coder flag, enabling Latin‑1 encoding, halving memory consumption, reducing GC pauses, and boosting overall application performance.

Compact StringsJDK9Memory Optimization
0 likes · 6 min read
How JDK 9’s Compact Strings Slash Java Memory Usage
Su San Talks Tech
Su San Talks Tech
Feb 14, 2021 · Fundamentals

7 Common Java String Pitfalls and How to Avoid Them

This article walks through frequent Java string‑related mistakes—including misuse of replace vs replaceAll, Integer equality pitfalls, BigDecimal precision issues, StringBuilder versus String, isEmpty vs isBlank, MyBatis mapper null checks, and indexOf logic—providing clear explanations, code examples, and best‑practice recommendations.

BigDecimalCode reviewMyBatis
0 likes · 13 min read
7 Common Java String Pitfalls and How to Avoid Them
ITPUB
ITPUB
Dec 8, 2020 · Fundamentals

Why Does Java’s String Have a 65,534‑Character Limit? Deep Dive into JVM Specs

Java’s String length is bounded by both the int‑based array limit (≈2 billion characters) and a JVM compile‑time restriction of 65,534 characters due to the constant‑pool’s u2 index, a nuance explained through source code examples, JVM spec excerpts, and a practical experiment.

Constant PoolJVMLength Limit
0 likes · 8 min read
Why Does Java’s String Have a 65,534‑Character Limit? Deep Dive into JVM Specs
macrozheng
macrozheng
Dec 2, 2020 · Fundamentals

Master Java’s StringJoiner: Clean, Efficient String Concatenation

This article explains how Java 8’s StringJoiner simplifies concatenating delimited strings compared to StringBuilder/StringBuffer, covering basic usage, constructors, methods, prefix/suffix handling, empty value configuration, stream‑style chaining, and the related String.join() API with practical code examples.

Java 8StringStringJoiner
0 likes · 7 min read
Master Java’s StringJoiner: Clean, Efficient String Concatenation
Programmer DD
Programmer DD
Nov 29, 2020 · Backend Development

Why Does Java Limit String Literals to 65,534 Characters?

This article explains how Java stores strings using a char array, the theoretical maximum length of 2^31‑1 characters, and why the JVM limits string literals to 65,534 characters due to constant‑pool u2 indexing, illustrated with code examples and a practical experiment.

Constant PoolJVMLength Limit
0 likes · 9 min read
Why Does Java Limit String Literals to 65,534 Characters?
Top Architect
Top Architect
Nov 26, 2020 · Fundamentals

Understanding Java String Length Limits: JVM Specification, Constant‑Pool Constraints, and Practical Experiments

This article explains why Java strings have length limits, detailing the char[] storage, the int‑based array size ceiling, the JVM constant‑pool u2 restriction of 65535 bytes, and demonstrates a compile‑time experiment building a 65,534‑character literal to illustrate the practical impact.

Constant PoolJVMLength Limit
0 likes · 8 min read
Understanding Java String Length Limits: JVM Specification, Constant‑Pool Constraints, and Practical Experiments
php Courses
php Courses
Nov 17, 2020 · Backend Development

Performance‑Optimized PHP: Faster Alternatives for Duplicates, Random Selection, Alphanumeric Checks, and Substring Replacement

This article presents several PHP function alternatives that significantly improve execution speed—such as using array_keys + array_flip for duplicate removal, mt_rand for random selection, ctype_alnum for alphanumeric testing, and strtr for substring replacement—backed by benchmark results and practical tips.

ArrayStringbenchmark
0 likes · 6 min read
Performance‑Optimized PHP: Faster Alternatives for Duplicates, Random Selection, Alphanumeric Checks, and Substring Replacement
php Courses
php Courses
Nov 9, 2020 · Backend Development

Performance‑Optimized Alternatives to Common PHP Functions

This article presents faster PHP alternatives for removing duplicate array values, selecting random elements, testing alphanumeric strings, and replacing substrings, providing benchmark results that show significant speed improvements and discussing trade‑offs and additional coding tips for better script performance.

ArrayStringbenchmark
0 likes · 6 min read
Performance‑Optimized Alternatives to Common PHP Functions
php Courses
php Courses
Nov 4, 2020 · Backend Development

Common PHP Functions and Code Snippets

This article presents a curated collection of useful PHP functions covering string generation, email encoding, validation, file handling, JSON/XML parsing, slug creation, IP detection, forced downloads, tag clouds, similarity checks, Gravatar integration, text truncation, ZIP compression, URL handling, clickable link conversion, image resizing, and AJAX request detection, each accompanied by ready‑to‑use code examples.

FileStringutilities
0 likes · 14 min read
Common PHP Functions and Code Snippets
Laravel Tech Community
Laravel Tech Community
Oct 16, 2020 · Backend Development

strrev() – Reversing a String in PHP

This article explains the PHP strrev() function, detailing its syntax, parameter description, return value, and provides a clear example that demonstrates how to reverse a string such as "Hello world!" using this built‑in function.

BackendStringTutorial
0 likes · 1 min read
strrev() – Reversing a String in PHP
Laravel Tech Community
Laravel Tech Community
Oct 13, 2020 · Backend Development

Using mb_strtolower() to Convert Strings to Lowercase in PHP

The article explains PHP's mb_strtolower() function, detailing its purpose to convert all alphabetic characters in a string to lowercase, describing its parameters, return value, and providing two illustrative examples—including handling of UTF‑8 encoded text.

PHPStringencoding
0 likes · 2 min read
Using mb_strtolower() to Convert Strings to Lowercase in PHP
Architect's Tech Stack
Architect's Tech Stack
Oct 13, 2020 · Fundamentals

Five Common Java String Interview Questions with Detailed Answers

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.

Stringequalityinterview
0 likes · 8 min read
Five Common Java String Interview Questions with Detailed Answers
Laravel Tech Community
Laravel Tech Community
Sep 30, 2020 · Backend Development

PHP mb_substr_count: Counting Substring Occurrences

The article explains PHP's mb_substr_count function, detailing its syntax, parameters, return value, and provides a practical example showing how to count the number of times a substring appears within a multibyte string.

BackendStringSubstring
0 likes · 2 min read
PHP mb_substr_count: Counting Substring Occurrences
Laravel Tech Community
Laravel Tech Community
Sep 29, 2020 · Backend Development

PHP mb_substr Function: Multibyte‑Safe Substring Extraction

This article explains the PHP mb_substr() function, detailing its multibyte‑safe substring behavior, parameter list (str, start, length, encoding), return value, and provides a clear example showing how to extract the first two characters from a Chinese string.

BackendPHPString
0 likes · 2 min read
PHP mb_substr Function: Multibyte‑Safe Substring Extraction
Laravel Tech Community
Laravel Tech Community
Sep 24, 2020 · Backend Development

PHP str_repeat Function – Repeating a String

The article explains PHP's str_repeat function, which repeats a given string a specified number of times, details its parameters, return value, usage constraints, and provides a sample code snippet demonstrating its output.

BackendStringfunction
0 likes · 1 min read
PHP str_repeat Function – Repeating a String
FunTester
FunTester
Sep 8, 2020 · Fundamentals

Mastering Java String Whitespace: trim, strip, replace and More

This article explains the various Java string methods for removing leading and trailing whitespace—including trim, strip, stripLeading, stripTrailing, replace, replaceAll, and replaceFirst—showing their differences, Unicode handling, and practical code examples.

.trimStringUnicode
0 likes · 8 min read
Mastering Java String Whitespace: trim, strip, replace and More
Laravel Tech Community
Laravel Tech Community
Sep 6, 2020 · Backend Development

PHP str_split() Function – Convert a String to an Array

The article explains PHP's str_split() function, which converts a string into an array of characters or fixed‑length chunks, details its parameters and return behavior, and provides example code with output, including demonstrating how split_length affects the result.

ArrayBackendPHP
0 likes · 2 min read
PHP str_split() Function – Convert a String to an Array
Laravel Tech Community
Laravel Tech Community
Sep 4, 2020 · Backend Development

Using PHP implode() to Convert an Array into a String

This article explains how the PHP implode() function joins the values of a one‑dimensional array into a single string, describes its parameters and return value, and provides clear code examples demonstrating typical usage and edge cases.

ArrayBackendPHP
0 likes · 2 min read
Using PHP implode() to Convert an Array into a String
Laravel Tech Community
Laravel Tech Community
Aug 27, 2020 · Backend Development

PHP trim() Function: Removing Whitespace and Specified Characters

This article explains PHP's trim() function, detailing how it removes leading and trailing whitespace or custom characters, describes its parameters and return value, and provides multiple code examples demonstrating default usage, custom character lists, and applying trim via array_walk.

.trimBackendString
0 likes · 3 min read
PHP trim() Function: Removing Whitespace and Specified Characters
Programmer DD
Programmer DD
Jul 22, 2020 · Fundamentals

Why Java’s char Can’t Represent All Unicode Characters – Understanding UTF‑16 and Code Points

This article explains how Java’s char type stores Unicode code units in UTF‑16, why its range of \u0000 to \uffff limits direct representation of newer Unicode characters, and how methods like String.length, getBytes, and code‑point APIs help handle multi‑byte characters such as emojis and rare Chinese glyphs.

Code PointsStringUTF-16
0 likes · 10 min read
Why Java’s char Can’t Represent All Unicode Characters – Understanding UTF‑16 and Code Points
Laravel Tech Community
Laravel Tech Community
Jul 1, 2020 · Backend Development

How to Convert Newlines to HTML Breaks with PHP’s nl2br Function

Learn how PHP's nl2br function inserts HTML line break tags before every newline in a string, understand its optional XHTML mode, see detailed parameter explanations, and explore three practical code examples demonstrating different newline scenarios and their resulting HTML output.

BackendHTMLPHP
0 likes · 2 min read
How to Convert Newlines to HTML Breaks with PHP’s nl2br Function
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Jun 13, 2020 · Fundamentals

Understanding Java String, StringBuilder, and StringBuffer

This article explains the immutable nature of Java's String class, compares it with mutable StringBuilder and thread‑safe StringBuffer, shows how the JVM handles string literals, constant pool, intern(), and provides performance guidelines and code examples for efficient string manipulation.

Stringimmutabilitystringbuffer
0 likes · 16 min read
Understanding Java String, StringBuilder, and StringBuffer
Programmer DD
Programmer DD
Jun 6, 2020 · Backend Development

5 Java String Interview Questions Explained with Memory Diagrams

This article walks through five common Java String interview questions, showing code examples, output results, and detailed memory‑layout analyses to explain why each comparison behaves as it does, helping readers master string handling in Java.

JDKStringjava
0 likes · 9 min read
5 Java String Interview Questions Explained with Memory Diagrams
Laravel Tech Community
Laravel Tech Community
May 31, 2020 · Backend Development

PHP str_shuffle() Function: Randomly Shuffle a String

The article explains PHP’s str_shuffle() function, detailing its syntax, parameter description, return value, and provides a complete example that demonstrates how to assign a string, shuffle it with str_shuffle, and output the randomized result.

PHPStringrandomization
0 likes · 1 min read
PHP str_shuffle() Function: Randomly Shuffle a String
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Feb 21, 2020 · Fundamentals

Longest Substring Without Repeating Characters – Sliding Window Analysis and Optimizations

This article explains the sliding‑window technique for solving the classic “Longest Substring Without Repeating Characters” problem, presents step‑by‑step analysis, demonstrates three Java implementations—from a basic set‑based method to hashmap and array optimizations—and discusses their time‑complexity improvements.

Sliding WindowStringalgorithm
0 likes · 8 min read
Longest Substring Without Repeating Characters – Sliding Window Analysis and Optimizations
Architecture Digest
Architecture Digest
Dec 11, 2019 · Fundamentals

Understanding Java String Concatenation, Constant Pool, and Bytecode Behavior

This article explains how Java handles String literals and concatenation, detailing the roles of the String constant pool, the effects of the '+' operator invoking StringBuilder.append, the placement of resulting strings in the heap versus the pool, and demonstrates these concepts through bytecode analysis and code examples.

Constant PoolMemory ManagementString
0 likes · 12 min read
Understanding Java String Concatenation, Constant Pool, and Bytecode Behavior
Programmer DD
Programmer DD
Sep 11, 2019 · Fundamentals

Why Java Strings Are Final and How Interning Affects Memory

This article explains the two ways to create Java strings, demonstrates how string literals are shared in the method area, shows the effect of the intern() method at runtime, and discusses why the String class is final, immutable, and thread‑safe.

Memory ManagementStringfinal
0 likes · 8 min read
Why Java Strings Are Final and How Interning Affects Memory
Programmer DD
Programmer DD
Aug 24, 2019 · Fundamentals

Why Java Strings Are Immutable and How It Boosts Performance

This article explains the concept of Java String immutability, illustrates how references work with examples and diagrams, and discusses the benefits such as string pool reuse, hashcode caching, thread safety, and security that improve memory efficiency and application performance.

Stringimmutabilityjava
0 likes · 8 min read
Why Java Strings Are Immutable and How It Boosts Performance
DevOps Cloud Academy
DevOps Cloud Academy
Aug 1, 2019 · Fundamentals

Python Basic Data Types: Strings, Numbers, Lists, Tuples, and Dictionaries with Examples

This article introduces Python’s fundamental data types—including strings, numbers, lists, tuples, and dictionaries—explaining their characteristics, common operations, built‑in methods, and providing clear code examples for each concept; it also covers escape sequences, slicing, concatenation, formatting, and basic arithmetic operators, helping beginners grasp essential Python programming constructs.

Data TypesListPython
0 likes · 11 min read
Python Basic Data Types: Strings, Numbers, Lists, Tuples, and Dictionaries with Examples
ITPUB
ITPUB
May 27, 2019 · Databases

Mastering Redis Data Types: Practical Tips and Real-World Use Cases

This article introduces Redis as an open‑source in‑memory store, outlines its core data structures—strings, hashes, lists, sets, sorted sets, bitmaps, hyperloglogs, and geospatial indexes—and provides concrete command examples, application scenarios, and best‑practice guidelines for effective usage.

CacheData StructuresHash
0 likes · 7 min read
Mastering Redis Data Types: Practical Tips and Real-World Use Cases
Java Captain
Java Captain
Mar 12, 2019 · Fundamentals

Java Basics Interview Questions and Answers – Part 1

This article presents a curated set of 208 Java interview questions, focusing on the Java Basics module, and provides detailed explanations, code examples, and analyses of concepts such as JDK vs JRE, == vs equals, hashCode, final, abstract classes, and common String operations.

JDKJREString
0 likes · 14 min read
Java Basics Interview Questions and Answers – Part 1
Java Captain
Java Captain
Dec 17, 2018 · Fundamentals

Understanding Java Heap and Stack Memory with Examples

This article explains the differences between Java heap and stack memory, their advantages and disadvantages, and demonstrates how string objects are stored and shared using code examples that illustrate memory allocation and reference behavior.

Garbage CollectionHeapMemory Management
0 likes · 4 min read
Understanding Java Heap and Stack Memory with Examples
Java Captain
Java Captain
May 3, 2018 · Fundamentals

Understanding Java Strings: Creation, Immutability, and Operations

This article explains Java's String class, covering its automatic import, how to create string objects without the new keyword, concatenation, immutability, common methods like replace, and provides useful API references and code examples for practical use.

APIImmutableString
0 likes · 6 min read
Understanding Java Strings: Creation, Immutability, and Operations
Java Captain
Java Captain
Mar 2, 2018 · Fundamentals

Understanding Java String, StringBuilder, and StringBuffer: Differences, Performance, and Interview Questions

This article explains the internal implementation of Java's String class, compares it with StringBuilder and StringBuffer, demonstrates performance differences through benchmark code, and provides common interview questions with detailed answers, helping developers choose the appropriate class for various scenarios.

Stringinterviewjava
0 likes · 16 min read
Understanding Java String, StringBuilder, and StringBuffer: Differences, Performance, and Interview Questions
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.

Stringfundamentalsimmutability
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.

AutoboxingObject ComparisonString
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 ObjectReflectionString
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.

HashingOverrideString
0 likes · 11 min read
Understanding Java's equals() and hashCode() Methods and How to Override Them