Cay Horstmann

In my copious spare time I write books and develop online courses for beginning and professional programmers.

2026-02-07

Jeff Martin and myself will speak at Java One (March 17-19, Redwood Shores, CA, USA) on Java and WebAssembly. Here is a $50 discount code if you register by Feb. 9: J12026SSM

horstmann.com/presentations/20

2026-02-05

On Tuesday, February 10, Maurice Naftalin and myself will speak at Voxxed Days CERN on "Streams—Below the Surface". horstmann.com/presentations/20

Cay Horstmann boosted:
Johannes Bechbergerparttimenerd
2026-02-03

Think you really know Java? ☕
Guess the Java version from code snippets in my Java Version Quiz: mostlynerdless.de/java-game/

Cay Horstmann boosted:
Ivar Grimstadivar_grimstad
2026-02-03

"Java: To infinity and beyond" kicked off by Sharat Chander at Jfokus

2026-02-01

On the plane to Stockholm where I will give two presentations at JFokus (jfokus.se/speakers.html?showid), on Project Valhalla and the Java Class File API.

2026-01-26

@parttimenerd I don't get it. Why wouldn't it be legal for Java ≥ 10? The var isn't necessary, but Core Java says it's there if you want to attach annotations to the parameter while being coy about its type.

Cay Horstmann boosted:
2026-01-22

AUSNAHMESTAPELÜBERWACHUNG!

(Wollte doch nur auswählen, wann meine neue Leiter geliefert werden soll 🥲)

Screenshot einer Webseite. Es wird ein Fehler angezeigt, weil en-DE ausgewählt ist. Text auf der Website:
Serverfehler in der Anwendung /.
Die Kultur wird nicht unterstiitzt.
Parametername: name
en-DE ist ein ungültiger Kulturbezeichner.
Beschreibung: Unbehandelte Ausnahme beim Ausführen der aktuellen
Webanforderung. Überprüfen Sie die Stapelüberwachung, um weitere
Informationen über diesen Fehler anzuzeigen und festzustellen, wo der
Fehler im Code verursacht wurde.

Ausnahmedetails: System.Globalization.CultureNotFoundException:
Die Kultur wird nicht unterstitzt.

Parametername: name

en-DE ist ein ungültiger Kulturbezeichner.

Quellfehler:

Beim Ausführen der aktuellen Webanforderung wurde eine unbehandelte
Ausnahme generiert. Informationen über den Ursprung und die Position
der Ausnahme können mit der Ausnahmestapelüberwachung angezeigt
werden.

Stapelüberwachung:
[CultureNotFoundException: Die
Kultur wird nicht unterstitzt.
Parametername:. name
en-DE ist ein ungultiger
Kulturbezeichner.]
System.Globalization.CulturelInf
0..ctor(String name, Boolean
useUserOverride) +202
System.Globalization.CulturelInf
0..ctor(String name) +12
2026-01-19

This Thursday January 22, I will be speaking at the Dublin JUG and the JChampionsConference, on Java pattern matching + a bonus talk for in-person attendees.

If you are in Dublin, sign up here: ti.to/dublin-java-user-group/2. Start time 18:15 UTC

To follow online, sign up here: eventbrite.com/e/jchampions-co. Start time 20:00 UTC

Cay Horstmann boosted:
johanvosjohanvos
2026-01-06

In case you're working with Java, I highly recommend the virtual JChampions Conference 2026 (jchampionsconf.com/ ) which will start on Jan 22. Have a look at the schedule, there are many great sessions by recognized Java champions. Get your free ticket at eventbrite.com/e/jchampions-co

2026-01-05

The excellent free JChampions Conference 2026 (jchampionsconf.com) is happening online Thur 1/22/2026, Fri 1/23/2026, Mon 1/26/2026, and Tues 1/27/2026.
Get free tickets from Eventbrite: eventbrite.com/e/jchampions-co

2026-01-01

@tagir_valeev Java doesn't take final into account with extends, so it treats T as an unknown subtype of Integer. Thus it is unsurprising that t = t + 1 or t += 1 fails. Interesting that ++/-- work.

2025-12-12

I just completed all 12 days of Advent of Code 2025! #AdventOfCode adventofcode.com/ 🎉 and can sleep in for the rest of the holiday season 🛌

2025-12-11

I just completed "Reactor" - Day 11 - Advent of Code 2025 #AdventOfCode github.com/cayhorstmann/advent Added a "DAG path count" method to my graph utilities.

2025-12-10

Here is my "Java Advent" article on nice and naughty cases of pattern matching, with nicer formatting than WordPress can muster, and the ability to leave comments without logging into WordPress: horstmann.com/unblog/2025-12-1

2025-12-10

I just completed "Factory" - Day 10 - Advent of Code 2025 #AdventOfCode github.com/cayhorstmann/advent The first time I ever used Z3. Very impressive.

2025-12-09

@mina Hi, the difference was between 3 min or so, and, after being more clever about it, less than a second.

2025-12-09

@timbray Wish them luck, but...how do you search right now? I used to think search is hard, but judging from Kagi, it doesn't take all that many paying customers (myself included) to do decent search.

2025-12-09

I just completed "Movie Theater" - Day 9 - Advent of Code 2025 #AdventOfCode github.com/cayhorstmann/advent

It's that time of the year when I get baffled by polygons in a grid, where it makes a difference whether a corner goes up or down, and it's not even easy to tell which, when the grid is too large to put in a char[][] array. Today, I resolved to figure out the geometry once and for all. Did you know that you can tell from the shoelace formula whether the traversal is clockwise?

2025-12-08

I participate in Advent of Code (adventofcode.com/) to learn, and today I learned plenty. My naïve brute force solution for Day 8 required 3 minutes. I re-learned the union-find algorithm (never touched it since grad school, 45 years ago), and am down to < 1 sec. github.com/cayhorstmann/advent

Client Info

Server: https://mastodon.social
Version: 2025.07
Repository: https://github.com/cyevgeniy/lmst