Java - Constant

1 - About

The names of constant fields are in upper-case letters.

By convention, the names of constant values are spelled in uppercase letters. If the name is composed of more than one word, the words are separated by an underscore (_).

3 - Implementation

3.1 - static final

You can create a class variable A constant member is defined with the modifier static and final.

final class Constants {

    static final char BACKSPACE = '\b';
    static final char COMMA = ',';

And import it in your other class, if you don't want to use the qualified name:

import static gerardnico.Constants.*;

3.2 - enum

Data Science
Data Analysis
Data Science
Linear Algebra Mathematics

Powered by ComboStrap