r/JavaProgramming • • Apr 09 '26

Am I making a mistake switching from C# .NET to Java after 13+ years?

6 Upvotes

r/JavaProgramming • • Apr 05 '26

Free online editor where you can write Java, run it, take notes, and export to PDF

6 Upvotes

Built an online editor that supports writing and executing Java directly in the browser. Useful for learning Java or creating study notes with runnable code alongside explanations.

Try it: https://8gwifi.org/math/editor.jsp

What it does:

  • Write Java in runnable code blocks — click Run or Ctrl+Enter to execute

  • See stdout/stderr inline below the code

  • Mix code blocks with formatted text, headings, tables

  • Export the whole document as PDF or LaTeX

  • Share via link — auto-saves to your browser

Good for:

  • Building a Java cheat sheet with runnable examples

  • Working through exercises and annotating with your own notes

  • Creating study guides for OOP, streams, records, pattern matching

  • Sharing notes with classmates or teammates

Try it: https://8gwifi.org/math/editor.jsp

Insert a code block from the toolbar (the </> button) or type / and select "Code Block". Pick Java from the dropdown and start coding.

No signup required. Free.


r/JavaProgramming • • Apr 05 '26

Java on IPhone 5s?! See how It's made:

Post image
6 Upvotes

r/JavaProgramming • • Mar 28 '26

From 872ms to 78ms: How I Eliminated GC and Bypassed JIT Bounds Checks in a Java 25 Log Scanner

6 Upvotes

Hey everyone,

I recently wanted to see how far I could push the JVM on a classic I/O problem: parsing a 1-million line log file to extract error counts per hour.

I started with the most naive, readable Spring-tutorial style approach (Files.readAllLines + Stream API). The baseline: 872ms and 19 GC pauses.

I decided to rewrite it step-by-step to understand the exact bottlenecks. In my final iteration (V04), I brought the execution time down to 78ms with absolutely Zero GC allocations, running on a single thread (Intel Core i5).

How I did it:

  1. Off-Heap Memory: I dropped String allocations entirely and used the FFM API (MemorySegment) mapped directly to the file via FileChannel.

  2. SWAR (SIMD Within A Register): Instead of reading byte-by-byte, I used ValueLayout.JAVA_LONG_UNALIGNED to load 8 raw bytes per CPU cycle. Since log lines are variable length, the memory isn't aligned, but modern x86 handles this beautifully.

  3. Bitwise Operations: I used bitmasks to locate the \n character across all 8 byte lanes simultaneously, and Long.numberOfTrailingZeros to pinpoint the exact offset.

  4. BCE (Bounds Check Elimination): By extracting the hour integer and using a bitmask index (hour & 0x1F), the JIT compiler could prove the value is always within [0,31], completely eliminating array bounds checks.

It was an amazing journey into mechanical sympathy and understanding what Java does under the hood.

I'd love to hear your thoughts or if you see any further micro-optimizations I might have missed!


r/JavaProgramming • • Mar 28 '26

Hello

6 Upvotes

good day


r/JavaProgramming • • Mar 26 '26

System Design Basics: TCP vs UDP

Thumbnail
javarevisited.substack.com
6 Upvotes

r/JavaProgramming • • Mar 17 '26

Java Developer connects to SqLite DB for the first Time? See the impression:

6 Upvotes

r/JavaProgramming • • Mar 17 '26

Copy constructor does not copy all fields.

6 Upvotes

Why do I see this warning with intellJ latest 25.3.3


r/JavaProgramming • • Mar 10 '26

Need a springboot mentor 😭

6 Upvotes

I’m a second year college student based in India , I desperately need a mentor who can really guide through my backend journey. I feel I’m not going somewhere in my life. Just did only 70 questions in leetcode and the peer in my college are achieving so much, I feel very stressed. I know Java, basics of oops , C++ and MySQL.

Comment down I’ll dm you.


r/JavaProgramming • • Mar 08 '26

I found Leetcode for System Design and its Awesome

Thumbnail
javarevisited.blogspot.com
6 Upvotes

r/JavaProgramming • • Mar 03 '26

Hello.

6 Upvotes

Hello everyone, I'm new to scheduling Java and I really need tips that helped you at the beginning of your learning, can you help me?


r/JavaProgramming • • Mar 02 '26

Help with extracting and comparing dates in Java for LLM

6 Upvotes

Hi everyone, i need some help. I have a large text that contains dates, and i need to extract them so i can compare them using an LLM to check if they are identical or not.

There are two types of dates in my text:

1- Literal dates: “In the year two thousand and twenty-two, on the twelfth day of the month of September”

2- Numeric dates: “12 September 2022”

I tried to extract and analyze them using only the LLM, but for some reason, even when the two dates are not the same, it sometimes returns that they are.

Now, I want to try extracting the dates in Java, saving them into two variables, and then passing them to the LLM. I think regex could work, but I’m not sure if that’s the best approach.

Has anyone done something similar or can suggest the best way to handle this?


r/JavaProgramming • • Feb 22 '26

The best project I’ve ever built in Java: My own language, DPL Dog Programming Language

Post image
6 Upvotes

Hi everyone! I wanted to share the project I’m most proud of from my 3 years with Java: DPL (Dog Programming Language).

It’s a custom language I built from scratch. Creating it was a massive lesson in logic, parsing, and execution. This project is actually what pushed me to start learning C — I want to understand how languages like this interact with memory at an even lower level.

Features of DPL:

Built entirely in Java.

Custom syntax and logic.

My personal milestone in software architecture.

Now that I'm building my C-Mastery-Lab

I’d love to hear from other language creators: What was the hardest part of building your first lexer/parser? And for the C veterans, any tips on porting high-level logic like this to a low-level environment?

Check it out here: https://github.com/Tuffy90/-DPL-Dog-Programming-Language


r/JavaProgramming • • Feb 15 '26

Wordle Clone in JavaFX

6 Upvotes

Hi guys ive been learning to code for 6 months now, I attempted to recreate Wordle using JavaFX

this project is kinda rushed which is why i left the code unorganized and messy 😅

i know its a bad habit for a beginner but i just wanna test the waters and see if i enjoy using JavaFX 😁

https://github.com/useriswave/JavaFX-Wordle-Clone


r/JavaProgramming • • Feb 05 '26

Want a simple way to play MP3 file in Java? Check out this simple tutorial:

6 Upvotes

r/JavaProgramming • • Jan 20 '26

How many of you are studying in IT related department

6 Upvotes

I wonder how many of you guys are currently studying in license program related to IT


r/JavaProgramming • • Jan 18 '26

Day 25 of learning java

Post image
6 Upvotes

Hi everyone, So today i continued with my expense tracker project by building a command parser

so given a command like: add —description “groceries” —amount 200, i extract the necessary info from this command and add it to expense list.

Tomorrow, i’ll starting working on a CommandHandler class for actually adding(removing, listing, etc) the items to the expense list.

See you guys tomorrow!


r/JavaProgramming • • Dec 31 '25

Centralizing dynamic route registration in Spring Boot microservices

6 Upvotes

I’m exploring an experimental idea around centralizing dynamic route registration in Spring Boot–based microservices.

In several systems I’ve worked with, dynamic routing logic ends up scattered across services, which makes it harder to test, reason about, and evolve. Some existing solutions also introduce relatively heavy dependencies or tight coupling to framework internals, which can complicate integration testing and mocking.

The approach I’m experimenting with focuses on:

• providing a minimal API for registering and removing routes at runtime

• keeping route storage, matching, and dispatching modular and testable

• avoiding deep coupling to Spring internals

• supporting integration tests with minimal setup

It’s designed as a lightweight Spring Boot starter, but the main emphasis is on simplicity, testability, and clear separation of concerns rather than feature completeness.

I’m interested in feedback on:

• whether centralizing dynamic routing like this makes sense in real-world microservice architectures

• potential design pitfalls or edge cases I should consider

• similar projects, libraries, or papers that tackle this problem in a lightweight way

This is currently an experimental, non-commercial project.

For reference only, the prototype implementation is available here:

https://github.com/JAI-create-spec/JAI-Router


r/JavaProgramming • • Dec 28 '25

Day - 6 of Learning Java

6 Upvotes

Hello World!

Today I started learning about loops and learnt about for loop. It's more or less similar to c language.. the only difference is, here we get an advance for loop! And it's freaking cool!!

Till I write again... 👋🏼


r/JavaProgramming • • Dec 27 '25

Day 12 of learning Java

Thumbnail
gallery
6 Upvotes

Hello guys, so for today I added two more classes to the Library Management project: Member and Librarian. So members can borrow and return books through methods provided by the library. The librarian also adds and removes books from the library. I researched how to make it so that the librarian is the only class that can add/remove books and realized i had to learn Inheritance(i dedicated this week for practicing what i learned so far, so i’ll come back to implement this feature next week)


r/JavaProgramming • • Dec 24 '25

Spring Boot 3.2 + Virtual Threads Is anyone else seeing 3x throughput or is it just me?

6 Upvotes

Hey everyone,

With all the hype around Java 21 LTS and Project Loom going mainstream in Spring Boot 3.2, I finally got to test virtual threads in a real microservice at work. We have a fairly I/O-bound REST service (database calls, external API requests). After migrating from a traditional u/Async and thread pool setup to virtual threads (yes, just adding spring.threads.virtual.enabled=true), our throughput literally tripled under load. Latency dropped, memory usage improved, and the code is so much simpler now no more worrying about ThreadPoolExecutor configurations or reactive programming complexity.I know reactive (WebFlux) had its moment, but this feels like cheating. Is anyone else experimenting with this in production? What has your experience been?

Also, for those who haven’t tried: Are you planning to adopt virtual threads, or sticking with reactive for now?

Discussion points

  • Success/horror stories with virtual threads so far.

  • Are there any hidden pitfalls compared to reactive?

  • What’s the biggest benefit you’ve seen?

  • Will this finally be the end of reactive programming hype in the Java ecosystem?


r/JavaProgramming • • Dec 21 '25

Day 23 of Learning Java

6 Upvotes

Hello guys, I hope you all had a great weekend. Today, I learned about an interesting topic: serialization, and how it is used to convert objects into bytes and vice versa. The most interesting thing I learned is that games use this technique to save and load game states, which is pretty cool.

That’s it for today. See you tomorrow.


r/JavaProgramming • • Dec 11 '25

Project idea 💡

6 Upvotes

Hello everyone Recently I did spring boot and currently I am learning spring Security and react Can you plz suggest me some project ideas to Strong my foundation of spring boot And also help in learning spring Security..

Can anyone also help me learning the spring security ..

Thanks


r/JavaProgramming • • Oct 28 '25

5 Must-Read Books to Master Software Architecture and System Design

Thumbnail
reactjava.substack.com
6 Upvotes