Skip to content
question

Returning to Java after 7 years (Java 8 to Java 21). What should I relearn first?

Meenal Deshpande@meenal_restarts

September 20, 2026 · 1 min read

Good morning all. It is 5.30 am here, the kids are not awake yet, so I am posting before the chaos starts 🙂

I was a Java developer at a service company till 2018: mostly Java 8, Spring 4 with XML configuration, and Struts on one old project (kindly do not laugh). After a seven year break I am preparing to return to work. Now I see Java 21 everywhere: records, var, sealed classes, pattern matching, virtual threads.

What I have already done:

  • Installed JDK 21 with SDKMAN
  • Built a small REST API with Spring Boot 3 following a tutorial (it worked, I was very happy)
  • Opened the list of JEPs from Java 9 to 21. It is very long, and I closed it again

Kindly guide: in what order should I learn the new features, for interviews and for actual work? And what can I safely ignore for now? I am having a query also about whether people still use Optional the way we did, or if that changed.

Thanking you in advance.

Accepted answer

Omkar Joshi#7 in Compiling27 likes

Welcome back Meenal! You already did the hardest part (actually starting). My order, from what I use daily on client projects: 1. var (Java 10). 10 minutes. Local variables only. 2. Records (16). Your DTOs become one line: record AccountDto(String iban, long balance) {} 3. Switch expressions (14) and pattern matching: instanceof with a variable (16), and switch on types with sealed interfaces (17/21). Example: sealed interface Payment permits Upi, Card, NetBanking {} record Upi(String vpa) implements Payment {} record Card(String last4) implements Payment {} record NetBanking(String bank) implements Payment {} String describe(Payment p) { return switch (p) { case Upi u -> "UPI " + u.vpa(); case Card c -> "Card ending " + c.last4(); case NetBanking n -> "Netbanking " + n.bank(); }; } No default needed, the compiler knows all cases. Add a new Payment type and every switch that misses it stops compiling. 4. Text blocks (15) for SQL and JSON in tests. 5. Small collection things: List.of, Map.of (9), stream.toList() (16). 6. Optional: same API, but use it only as a return type. Not for fields, not for parameters. That is what changed in practice. 7. Virtual threads (21): understand the idea. In Spring Boot 3.2+ it is one property, spring.threads.virtual.enabled=true. Safe to ignore for now: modules (JPMS), almost nobody uses them in app code. Nashorn was removed anyway. Outside the language: Spring Boot 3 with Java config only, JUnit 5, Testcontainers, basic Docker. That covers 90% of interviews I have taken on the client side.

View in the thread

Get the best of #compiling weekly

One email each Monday with the most useful posts. No spam; unsubscribe in one click.

Comments

10

Sign in to join the conversation.

Sign in to comment
Rohit Verma@rohit_codes#9 in Compiling
Meenal ji welcome back 🙏 Struts pe koi nahi hasega, aadhe banks aaj bhi usi pe chal rahe hain 😂 @omkar_java ye tumhara area hai, dekho zara
8 net votes

Accepted answer

Omkar Joshi@omkar_java#7 in Compiling
Welcome back Meenal! You already did the hardest part (actually starting). My order, from what I use daily on client projects: 1. var (Java 10). 10 minutes. Local variables only. 2. Records (16). Your DTOs become one line: record AccountDto(String iban, long balance) {} 3. Switch expressions (14) and pattern matching: instanceof with a variable (16), and switch on types with sealed interfaces (17/21). Example: sealed interface Payment permits Upi, Card, NetBanking {} record Upi(String vpa) implements Payment {} record Card(String last4) implements Payment {} record NetBanking(String bank) implements Payment {} String describe(Payment p) { return switch (p) { case Upi u -> "UPI " + u.vpa(); case Card c -> "Card ending " + c.last4(); case NetBanking n -> "Netbanking " + n.bank(); }; } No default needed, the compiler knows all cases. Add a new Payment type and every switch that misses it stops compiling. 4. Text blocks (15) for SQL and JSON in tests. 5. Small collection things: List.of, Map.of (9), stream.toList() (16). 6. Optional: same API, but use it only as a return type. Not for fields, not for parameters. That is what changed in practice. 7. Virtual threads (21): understand the idea. In Spring Boot 3.2+ it is one property, spring.threads.virtual.enabled=true. Safe to ignore for now: modules (JPMS), almost nobody uses them in app code. Nashorn was removed anyway. Outside the language: Spring Boot 3 with Java config only, JUnit 5, Testcontainers, basic Docker. That covers 90% of interviews I have taken on the client side.
27 net votes
Meenal Deshpande@meenal_restarts#4 in Compiling
Omkar, thank you so much. This is exactly the order I needed. The sealed + switch example made pattern matching clear in one look. Saved. I will do records and switch this week after the kids sleep 🙂
2 net votes
Ankit Khurana@faang_or_bust2 rep in Compiling
7 year gap in 2026 lol. market is brutal, freshers with 500 leetcode are jobless. good luck i guess
9 net votes
Meenal Deshpande@meenal_restarts#4 in Compiling
Thank you for the wishes. Seven years ago I was also the person in the office answering questions at 9 pm. In these seven years I raised two children and cared for my father, which taught me more about priorities and deadlines than any sprint did. I am not asking if the market is easy. I am asking what to learn. If you have a suggestion on that, I will be grateful 🙂
5 net votes
Rohit Verma@rohit_codes#9 in Compiling
ye reply frame karke office mein lagana chahiye 🙏😂
3 net votes
Sneha Kulkarni@laidoff_not_out2 rep in Compiling
meenal 👏 the most polite destruction i have seen on this site. also our mock on saturday is still on, i'll ask you records questions now
6 net votes
Tomasz Kowalski@tomasz_k#8 in Compiling
Good list from Omkar. I add one: learn to read Spring Boot 3 stack traces, they are longer than in your time. And ignore modules, everybody ignores them, including Spring.
7 net votes
Kunal Bhatia@kunal_dsa2 rep in Compiling
for interviews: records + streams + one virtual threads question is what I saw in 4 of 5 Java rounds this year. nobody asked about modules. you will be fine 🙏
3 net votes
Anitha Joseph@anitha_miss1 rep in Compiling
Very well asked, Meenal. You already did more than most of my students: installed, built something, then asked. One small suggestion: write the same small program in Java 8 style and Java 21 style side by side. The difference will stay in your memory. All the best.
5 net votes