Skip to main content

Java

Java Comparable vs Comparator: The Definitive Guide with Examples

Understand the difference between Java Comparable and Comparator with side-by-side examples, a decision guide, and modern Java 8 Comparator chaining techniques. Covers naturalOrder, reversed(), thenComparing(), nullsFirst(), and common pitfalls.

Complete Guide to Logback RollingFileAppender

Master Logback RollingFileAppender with time-based, size-and-time, and fixed-window rolling policies. Includes production-ready logback.xml examples, Spring Boot integration, async logging, and a complete FAQ.

Implementing Vector Embeddings and Semantic Search in Pure Java

A complete implementation of a semantic search engine in pure Java — no external libraries. Covers TF-IDF vectorisation, cosine similarity, and document ranking by meaning. Explains the mathematics behind vector embeddings, how they power RAG and AI search systems, and provides a working query engine with annotated code and sample output. The same architecture used by Pinecone, Weaviate, and Elasticsearch — built from scratch.

Building a Neural Network from Scratch in Pure Java (No Libraries)

A complete, from-scratch implementation of a feedforward neural network in pure Java — no TensorFlow, no DL4J, no external libraries. Covers the Neuron model, forward propagation, sigmoid activation, backpropagation with gradient descent, and trains the network to learn the XOR function. Every line of code is annotated with the underlying mathematics so you understand exactly what the network is doing at each step.

Building a REST API with Spring Boot: Complete Beginner's Guide

A complete beginner's guide to building a REST API with Spring Boot 3. Covers project setup, clean package structure, a Java record model with Bean Validation, a service layer, a @RestController with GET/POST/PUT/DELETE endpoints, global exception handling with @RestControllerAdvice, and end-to-end curl testing u2014 with fully annotated code throughout.

Java Collections Framework: Choosing the Right Data Structure

A complete, reference-level guide to the Java Collections Framework. Covers ArrayList vs LinkedList, HashSet vs LinkedHashSet vs TreeSet, HashMap vs LinkedHashMap vs TreeMap, PriorityQueue, ArrayDeque, and immutable collections u2014 with time-complexity tables, annotated code examples, and a decision guide for choosing the right data structure.

Java Streams API: The Complete Reference Guide

A complete, reference-level guide to the Java Streams API (Java 8+). Covers stream creation, intermediate operations (filter, map, flatMap, sorted, distinct, peek), terminal operations (collect, reduce, count, findAny, anyMatch), collectors, parallel streams, and the most common pitfalls u2014 with fully annotated code and sample output for every example.

10 AI Prompts to Debug and Fix JUnit 6 Test Failures

10 AI prompts for debugging and fixing broken, flaky, and incorrectly behaving JUnit 6 tests. Each prompt is structured to provide complete failure context — stack traces, test code, production code — and diagnose root causes across assertion errors, NPEs, Mockito issues, Spring context failures, Testcontainers problems, and more.