Chat with Your Knowledge Base: A Hands-On Java & LangChain4j Guide

Disclaimer: This article details an experimental project built for learning and demonstration purposes. The implementation described is not intended as a production-grade solution. Some parts of the code were generated using JetBrains’ AI Agent, Junie. Large Language Models (LLMs) like GPT-4, Llama, and Gemini have revolutionized how we interact with information. However, their knowledge is … Read more

Java Tips # 01 –  Writing Shebang Scripts in Pure Java

Did you know you can write a CLI script in Java just as easily as you would in a bash script, and run it directly from the shell? This is commonly called a shebang script, though we are mostly familiar with writing them in bash. Bash scripts are great, but they can be obscure to … Read more

Exploring New Features in JDK 23: A Sneak Peek

The main method and println With JDK 23 on the horizon, I decided to dive into some of its new features by running the following code in the CLI: void main() { println(“Hello World”); var name = readln(“Enter your name: “); println(“Your name is ” + name); var age = readln(“Enter your age: “); println(“Your … Read more

Optional in Java: A Swiss Army Knife for Handling Nulls and Improving Code Quality

Optional is a Java class that provides a way to handle null values in a type-safe and efficient manner. It can help you avoid null pointer exceptions, simplify your code, and improve its readability and maintainability. This tutorial will cover the features and use cases of Optional in Java, with practical examples of how to use it for handling nulls