1.Java identifiers, reserved words, and numeric systems

Source: Internet
Author: User

One. Java identifiers

The name tokens used by programmers to name individual elements in a program are called Identifiers (identifier). In the Java language, identifiers are a sequence of characters starting with letters, underscores (_), dollar symbols ($), followed by letters, underscores, dollar symbols, and numbers. For example,identifier,username,user_name,_sys_val, $change is a valid identifier, and 2mail Room#,class is an illegal identifier.

Two. java Reserved words

Have a special meaning and purpose and cannot be used as a generic identifier, these identifiers are called reserved words (reserved word), also known as keywords, and all reserved words in the Java language are listed below:
Bstract,break,byte,boolean,catch,case,class,char,continue,default,double,do,else,extends,false,final,float,for , Finally,if,import,implements,int,interface,instanceof,
Long,length,native,new,null,package,private,protected,public,return,switch,synchronized,short,static,super,try , True,this,throw,throws,threadsafe,transient,void,while.

Reserved words in the Java language are represented in lowercase letters.

Three. The numbering

The numbers can be said to be purely mathematical content, but in computer language development, the use of more frequent. In programming languages, the numbering system typically includes binary, octal, decimal, and hexadecimal.

1. Binary
Binary features: There are two numbers consisting of: "0" and "1", and every binary one.

For example: 1100110011, 10000001.

2. Octal
Octal features: There are 8 numbers: "0", "1", "2", "3", "4", "5", "6", "7", and every eight in the operation.

For example: 014, 729.

Note: The octal data has a 0 prefix. It is often confusing with binary, so it is advisable not to use octal in Java programming.

3. Hexadecimal
Hexadecimal features: There are 16 numbers: "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", and every 16 in the operation.

Example: 0XB.

Note: Hexadecimal uses the five letters of a, B, C, D, E, F, respectively, to represent 10-15. Letters are case insensitive. The hexadecimal data has a 0X prefix.

4. Decimal
Decimal features: There are 10 numbers: "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", and every 10 in the operation.

For example: 89, 92.

1.Java identifiers, reserved words, and numeric systems

Related Article

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.