http://www.verejava.com/?id=16992564786810
The constants in the /*java are divided into the following 1. Integer constant 2. Floating-point constant 3. character constant 4. Boolean constant 5. String constant */public class finalvariable{public static void main (S Tring[] args) {//constant: Variable//1 cannot be changed. Integer constant final int up=0; final int down=1; final int left=2; final int right=3; System.out.println (UP); System.out.println (down); System.out.println (left); System.out.println (right); /* Note: 1. The definition of constants is generally capitalized *///2. Floating-point constant final float pi=3.14f; System.out.println (PI); 3. Boolean constant Final Boolean run=true; System.out.println (RUN); 4. Character constant final char a= ' A '; System.out.println (A); System.out.println (' \ R '); System.out.println (' \ '); System.out.println (' \ '); System.out.println (' \ \ '); 5. string constant final string const= "Auld lang Syne"; System.out.println (CONST); }}/* Summary: 1. A constant's naming convention is the same as a variable 2. Constants are generally capitalized 3. The constant is preceded by the final keyword 4. Constants cannot change values */
http://www.verejava.com/?id=16992564786810
Constants of the Java Foundation