Andr7st

Andr7st

Hobby blog

Posts

Array trivia and curiosities
Latest
java:arrays

Array trivia and curiosities

The drawer of loose facts: JVM descriptors, the real maximum size of an array, why passwords are stored in char and not in String, the arraylength instruction, the only array println knows how to print, and other oddities that didn't fit into any post but are worth it.


Written by
Andrés Segura
Id

jaa11

Posted

Sep 29, 2026

java
arrays
trivia
curiosities
mucho-texto
Read
Other articles

(11)

The limits of arrays: why the Collections API exists
java:arrays
The limits of arrays: why the Collections API exists

Fixed size, no insert or delete, no search by contents, no useful toString, no guarantees of uniqueness or order. The honest inventory of what an array doesn't do — which is exactly the table of contents of the next series.

Sep 28, 2026
java
arrays
collections
limitations
Varargs: arrays disguised as parameters
java:arrays
Varargs: arrays disguised as parameters

A varargs parameter is an array with a different face. What the compiler does, why main(String[] args) and main(String... args) are the same, the overloading rules that confuse people, and what @SafeVarargs means.

Sep 26, 2026
java
arrays
varargs
methods
Covariance, generics and ArrayStoreException
java:arrays
Covariance, generics and ArrayStoreException

Arrays are covariant and generics aren't: why Object[] objects = new String[3] compiles and fails at runtime, why you can't write new T[], and how to live with toArray(T[]).

Sep 25, 2026
java
arrays
generics
covariance
type-safety
The Arrays class: the toolbox almost nobody squeezes
java:arrays
The Arrays class: the toolbox almost nobody squeezes

A complete tour of java.util.Arrays: sort, binarySearch, fill, setAll, copyOf, compare, mismatch, toString, deepToString, stream, parallelSort and parallelPrefix — with the asList trap explained separately.

Sep 25, 2026
java
arrays
java-api
utilities
Copying and comparing arrays: shallow copy, clone and equals
java:arrays
Copying and comparing arrays: shallow copy, clone and equals

Why b = a copies nothing, what clone() does with an array of objects, when to use System.arraycopy or Arrays.copyOfRange, and why equals() on arrays is almost never what you want — but Arrays.equals and deepEquals are.

Sep 25, 2026
java
arrays
cloning
equality
Iterating an array: for, for-each and streams
java:arrays
Iterating an array: for, for-each and streams

The three ways to iterate an array and what you gain and lose with each one: the classic indexed for, the for-each and its syntactic sugar, and Arrays.stream with IntStream to avoid paying for boxing.

Sep 25, 2026
java
arrays
iteration
streams
Featured

(3)

Cookie policy
blog:info
Cookie policy

What gets stored in your browser when you visit this site: two technical preference cookies, none for advertising or tracking, and what happens when a post embeds a third-party video.

Nov 04, 2025
cookies
privacy
legal
gdpr
Licenses and attributions
blog:info
Licenses and attributions

The third-party fonts, images, trademarks and libraries this site uses, with their license and attribution — and the terms the site's own content is published under.

Nov 04, 2025
licenses
attributions
legal
open-source
About this blog: what it is, how it's organized, and what to expect
blog:info
About this blog: what it is, how it's organized, and what to expect

What this publishing project is: the topics it covers, how posts are grouped into series, why every article ships with audio and diagrams, how AI-generated content is flagged, and where to find the licenses, cookies and privacy pages.

Aug 17, 2026
blog
information
organization
transparency