Skip to main content

String.format, formatted() and printf in Java: The Complete Cheat Sheet

A Java String.format cheat sheet where every output was run on JDK 25: specifier anatomy, padding and alignment, why %.2f can disagree with C, locale traps, the lakh/crore grouping Formatter cannot produce (with a working formatter), the exceptions it throws, and what it costs against +.

MCP Beyond Tools in Java: Resources, Prompts, Sampling and Elicitation

Most MCP servers stop at tools. This post builds an incident-desk server in Java with resources, a prompt, sampling and elicitation on Spring AI 2.0.2 and MCP SDK 2.1.0, then breaks it on purpose: a client without the capability, a slow client, a stateless server that silently drops every tool, and what the 2026-07-28 spec changes.