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

Sponsored content