Constants of the Java Foundation

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.