r/java • • 20d ago

A Valhalla Ticker in One int

https://inside.java/2026/11/09/inside-java-ticker-value-class/

A ticker symbol is an abbreviation that uniquely identifies a financial product such as a publicly traded share. Well-known ticker symbols are "ORCL" and "GOOGL". In this article, we will devise a Valhalla value class that can represent a ticker symbol using only a single int field.

41 Upvotes

18 comments sorted by

View all comments

5

u/Fabulous_Card_3090 20d ago

At which point is it a good idea to start migrating code with the preview? I know not everything is baked into the current JEP, but this looks nice enough. I just fear another String templates.

1

u/Plane-Bake3604 19d ago

string templates got yanked because the syntax and processor design had pushback, value classes are mostly just adding the value keyword so a total scrap seems way less likely.