About 2,260,000 results
Open links in new tab
  1. Constants in Java: Patterns and Anti-Patterns | Baeldung

    Jan 8, 2024 · A constant is a variable whose value won’t change after it’s been defined. Let’s look at the basics for defining a constant: private static final int OUR_CONSTANT = 1; Copy Some …

  2. java - List all constants of specified class - Stack Overflow

    Nov 3, 2014 · My question is: how to create a list of all constants of specified class? Is this possible in an easy way? Or I just need to write my own (somewhat simple) solution for this? …

  3. Constants in Java | Types, Example - Scientech Easy

    Nov 25, 2025 · Learn types of constants in java with example program, integer, real, character, and string constants, decimal, octal, hexadecimal, backslash

  4. Types of Constants in Java - Tpoint Tech

    In Java, a widely used object-oriented programming language, constants are integral for creating maintainable and readable code. This article delves into the different types of constants in …

  5. Java Constants: Types, Declaration, Examples

    Learn about constants in Java with examples. Understand why constants are used, how to declare them, the different types, best practices, and more.

  6. Declaring Constants in Java: A Comprehensive Guide

    Nov 12, 2025 · By using constants, developers can define values that are fixed and should not be modified, such as mathematical constants (e.g., `PI`), status codes, or configuration settings. …

  7. Java Constants - Compile N Run

    Learn how to use constants in Java, their importance, and best practices for declaring and using constant values in your programs.

  8. Constants and Enumerated Types in Java - DEV Community

    Aug 19, 2025 · Introduction to Constants To create constants in Java, we use the final keyword to represent values that will not change. By convention, the variable name for a constant is …