Originally posted by Arifa Riaz:
The names of CONSTANT variables can be class constants or ANSI constants should be all uppercase with words separated by underscores ("_").
ANSI constants should be avoided, for ease of debugging.
An example: static final int MIN_WIDTH = 4;
My question: What are ANSI constants ?
ANSI is actually an orginization the establishes standards that makes life easier on all of us. There are ANSI standards established for a lot of things. ASCII the numeric encoding that maps the value to the character representation ie 65 = A, is covered by an ANSI standard. NaN (not a number) is a value that can be return by floating point calculations, and that value is defined by ANSI in conjuction with IEEE. Constants are established for a lot of things by ANSI especially in areas of communications such as SQL, Character Sets, colors ( thats why black is a value of 0 on most computers!) etc. So if you define a constant that represents a constant defined in an ANSI standard such as
public static final ANSI_BLACK = 0;
you should follow these conventions.
(Notice Sun violates these conventions a lot as with NaN, Color.black etc.)