Quantcast
Channel: Java Archives - Java Code Geeks
Browsing index pages (1303 articles)

Java Scoped Values: A Practical Example

ScopedValue provides a way to share contextual data with methods without passing that data explicitly through every method parameter. A scoped value is bound only while a specific block of code is...

View Article


Goroutines vs. Virtual Threads: Two Routes to Lightweight Concurrency, a...

Go built its language around message passing from day one. Java spent thirty years on shared memory, then had to retrofit structure onto both. Go shipped goroutines complete in its first public release...

View Article


Java Compact Source Files: No Class, No Static Main

Java has traditionally required a class and a static main method even for the smallest programs. Java 25 changes this with compact source files and instance main methods, providing a simpler way to...

View Article

How to Fix Jackson LocalDate JSON Parse Errors

Jackson is one of the most commonly used libraries for converting JSON data into Java objects and vice versa. When working with Java’s modern date and time API, developers may sometimes encounter an...

View Article

DB-Scheduler: A Reliable Scheduler for Java

Scheduling background jobs is a common requirement in Java applications. Applications often need to send notifications, generate reports, clean up old data, synchronize information, or execute business...

View Article


Multiple Dispatch: Julia’s Different Answer to the Expression Problem

Sealed interfaces close the type list. Julia opens it, and the operation list, at once. A recent piece on this site walked through how sealed interfaces and exhaustive switch expressions give Java a...

View Article

Understanding Java AtomicInteger with an Example

When multiple threads access and modify the same variable, unexpected results can occur due to race conditions. A simple int variable is not thread-safe when it is updated concurrently. Java provides...

View Article

Understanding Java Virtual Threads with Example

Virtual Threads are one of the most important improvements to Java concurrency in recent years. They make it possible to run a very large number of concurrent tasks without creating the same number of...

View Article


Checked Exceptions: The Language Design Debate Java Never Resolved

Why Java stands almost alone among mainstream languages in forcing you to declare or catch certain exceptions, the criticism that shaped C# and Kotlin, and whether the reasoning behind it held up....

View Article


Java’s Sealed Classes Meet the Visitor Pattern

Replacing a classic GoF pattern with pattern matching: a before and after refactor of a Visitor hierarchy, collapsed into a sealed interface and an exhaustive switch expression. The Visitor pattern has...

View Article

How to Switch Between AI Models Automatically

AI applications do not always need the same language model for every request. A simple factual question may only require a small, fast model, while a request involving multiple constraints, reasoning...

View Article

Intelligent Document Processing with Apache Camel, Docling & LangChain4j

Enterprise applications often need to process large numbers of documents such as PDFs, invoices, manuals, reports, and policy documents. Extracting text from these documents is only the first step; the...

View Article

LLM Tool Call Reasoning with Embabel AI

Large language models become significantly more useful when they can interact with external tools instead of only generating text. A model can decide that it needs information from a database, an API,...

View Article


Introduction to HyDE: Hypothetical Document Embeddings for RAG

Retrieval-Augmented Generation (RAG) has become one of the most common approaches for building AI applications that need to work with external or private knowledge. Instead of asking an LLM to answer a...

View Article

Haskell’s Monads Outside Academia: A Plain-Language Guide

Ask ten developers what a monad is, and you will likely get ten different answers, most of them nervous. The word carries a reputation for being abstract, mathematical, and mostly useless outside of...

View Article


G1’s Own Throughput Fix: JEP 522 and the Quiet Death of “G1 Trades Throughput...

For a decade and a half, “G1 gives up some throughput for lower pause times” has been treated as a law of nature rather than an engineering choice. JEP 522 shipped in JDK 26 and quietly demonstrated...

View Article

Introduction to Apache Causeway

Building an enterprise application often involves implementing the same infrastructure repeatedly: domain objects, user interfaces, validation, persistence, navigation, and business operations. Apache...

View Article


Null Safety and the Billion-Dollar Mistake

Tony Hoare spent one sentence apologizing for the null reference and the software industry has spent six decades cleaning up after it. Kotlin, Java, and Rust each answer his mistake with a genuinely...

View Article

LLM-as-a-Judge with Spring AI Recursive Advisors

Large Language Models (LLMs) are increasingly used not only to generate content, but also to evaluate the output produced by other models. This technique is commonly known as LLM-as-a-Judge. Spring...

View Article

LLM Integration: Apache Camel & OpenAI Component

Large Language Models (LLMs) are increasingly becoming part of enterprise applications. However, integrating an LLM into an existing application is not only about invoking an API. Enterprise...

View Article
Browsing index pages (1303 articles)


Latest Images