1. Key words
1.1. Words that are given meaning by the Java language (e.g. class,interface,public, static)
1.2. All lowercase
1.3. Precautions (Goto and const are reserved as key words)
2. Identifiers
2.1, to the class, interface, method, the character of the name of the variable
2.2. Composition rules (A: English case, B: Data, c:$ _)
2.3. Precautions (cannot start with a number, cannot be a key word in Java, case-sensitive)
2.4. Common naming rules (see name)
A: The package is all lowercase
Single-level package: lowercase such as: peng,com
Multi-level package: lowercase such as: Cn.hcc,ts.hnyj,com.baidu
B: Class and interface:
A single language: Capitalize the first word such as hello,student
Multiple words: Capitalize the first word of each word, such as Helloworld,studentname
C: Methods and Variables:
One word: First letter lowercase such as Name,main,get
Multiple words: First letter lowercase, starting with the second word capitalize the first word such as Showallstudents,getpersonname,classname
D: constant: All caps
One word: all uppercase
Multiple words: Multiple capitals while each word is separated by _ such as Max_age
3. Constants
3.1 The amount of the value does not change during program execution
3.2 Categories:
3.2.1, string constant "Hello",
3.2.2, Integer constant 12, 23,
3.2.3, decimal constant 12.33,
3.2.4, Boolean constant True,false
3.2.5, character constant ' a ', ' B '
3.2.6, empty constants
3.3 provides four representations of integer constants in Java
A: Binary consists of 0, 1, starting with 0b
B: octal is composed of 0---7, starting with 0
C: Decimal with 0----9, integer by default is decimal
D: Hex with 0----abcdef (case can) start with 0x
4, the conversion between the binary
The other ways to convert the binary to decimal are:
1112 = 1*10^3 + 1*10^2 + 1*10^1+2*10^0 = 1000+100+10+2 = 1112
0b00001010 = 1*2^3 + 1*2^0 = 8 + 2 = 10
----to Be Continued
A review of Java Fundamentals: Key words, identifiers, annotations, constants, conversions, variables, data types, data type conversions