---
title: "Java: Constants"
date: 2015-01-01
description: "Tom Johnson’s blog on technical writing and AI: agent skills, docs for AI agents, docs-as-code, tech comm careers, and an API documentation course."
canonical_url: https://idratherbewriting.com/java-constants/index
---

> For AI agents: a documentation index is available at https://idratherbewriting.com/llms.txt. Markdown versions of all pages are available by appending .md to any page URL.

# Java: Constants

Constants are fields that hold values that do not change. It’s a custom to format constants in full caps. When you have a modifier of “final”, it’s a constant.

Here’s a sample constant:

> private static final String EXCEPTION_MESSAGE = “ints must contain at least one int”;
>
> – Java 7 for Absolute Beginners
