Watch the video review Java for some time. Although the things I do now are net, I haven't forgotten to review Java.
More probably here.
Naming rules for Java variables:
(A) Composition rules:
1: English uppercase and lowercase letters
2: Number
3:$ and _
(2) precautions:
A: Cannot start with a number
B: cannot be a keyword in Java
C: Case Sensitive
(3) Common naming conventions (see Name and meaning)
A: Package All lowercase
Single-level package: lowercase
Example: jiemo,com
Multi-level package: lowercase, and separated by.
Example: Cn.jiemoxiaodi,com.baidu
B: Class or interface
One word: Capitalize the first letter
Example: Student,demo
Multiple words: Capitalize the first letter of each word
Example: Helloworld,studentname
C: Method or Variable
One word: First letter lowercase
Example: Name,main
Multiple words: Start with the second word, capitalize the first letter of each word
Example: Studentage,showallnames ()
D: Constant
All caps
One word: Uppercase
Example: PI
Multiple words: Uppercase and separated by _
Example: Student_max_age
Comments in Java:
1, single-line//
2, multi-line/**/
I start with the basic data type:
note:
integers by default are of type int, and floating-point numbers are double by default.
long integers to be added L or L.
Single-precision floating-point numbers are added F or f.
number According to type |
|
byte |
short |
2 |
int |
4 |
|
8 |
|
4 |
double |
char |
2 |
boolean |
1 |
Data type Conversions
(1) Boolean type does not participate in conversions
(2) Default conversion
A: From small to large
B:byte,short,char--INT--long--float--double
C:byte,short,char do not convert each other, directly into the int type participates in the operation.
(3) Forced conversion
A: from big to small
B: There may be a loss of precision, generally not recommended for such use.
C: Format:
Target data type variable name = (target data type) (converted data);
Java Review Consolidation