Key words
Annotation characters
Comments
Constants and variables
Operator
Statement
Function
Array
---keyword is a word that is given a specific meaning by the Java language
---characters that make up a keyword are all lowercase
---keyword considerations
Goto and const as reserved words
---Identifiers to classes, interfaces, methods, variables, etc. names are used by the character sequence
Composition rules: English uppercase and lowercase alphanumeric characters $ and _
Precautions
/*
Markers are names for classes, interfaces, methods, variables, etc.
Composition rule:
English letter Case
numeric characters
$_
Precautions:
Cannot start with a number
cannot be a Java keyword
Case sensitive
Naming conventions common to identifiers
1, see the name of the idea
2, Package: In fact, the folder is used to distinguish the same class name
All lowercase
Single-stage Package Liuyi
Multi-level package Cn.jiemoxiaodi
Class or interface:
A word composition: The first letter of the word must be capitalized
Example: Student,dog
Multiple words
Example: Helloworld,studentname
Methods and variables:
One word: The first letter of the word lowercase
Multiple words: Starting with the second word, capitalize the first letter of each word
Constant:
One word: all caps
Multiple words: Each letter is capitalized, the word is separated by _
Example: Student_max_age
*/
/*
Note: Text used to interpret the description program
Classification and formatting of annotations in Java
Single-line Comment://can be nested with
Multiline Comment: cannot be nested using
Document comment: Generated by Javadoc tool parsing a document
*/
This is my note.
/*
Constant Demo
Classification:
A: Literal constants
B: Custom Constants
Literal constants:
A: The contents of a string constant enclosed in double quotation marks
Example: "Hello"
B: Integer Constants
C: Decimal constant
D: Character Constant "
E: Boolean Constants
F: Empty constant null
*/
/*
Constant Demo
Classification:
A: Literal constants
B: Custom Constants
Literal constants:
A: The contents of a string constant enclosed in double quotation marks
Example: "Hello"
B: Integer Constants
C: Decimal constant
D: Character Constant "
E: Boolean Constants
F: Empty constant null
*/
1byte=8bit
1k=1024byte
1m=1024kb
1g=1024m
1=1024g
/*
Different binary data performance:
Binary: consists of 0 1, starting with 0b
Octal starting from 0---7 with 0
Decimal by 0---9 by default is decimal
Hex 0---9 a b c D E F start with 0x
*/
Java NOTE 2