Input:
Import Java.util.Scanner;
Scanner Scanner = new Scanner (system.in);//Input Object
Scanner.close ();//Close Scanner
Scanner.nextint ();//integral type for absorbing inputs
Scanner.next ();//Absorbing strings
Scanner.nextboolean ();//Absorbing Boolean type
Scanner.nextbyte ();//absorption byte type
Scanner.nextdouble ();//absorbing double precision type
Scanner.nextfloat ();//absorption single precision type
Scanner.next (). charAt (0);//Absorbing single characters
Scanner.nextshort ();//absorbing short-integer
Scanner.nextlong ();//absorption of long plastic
-
Constant
1. Integer Constants 123
2. Decimal constant 1.23
3. Boolean (Boolean)-type constant true
4. Character constant ' 1 '
5. String constant "123 Plan on Time"
6.NULL constant NULL
Variable
Why use variables
--memory address is not easy to remember, reuse, convenient operation
To define the format of a variable
--Variable name of data type = initialization value;
Identifier naming rules
--First character: letter, underscore, ' $ ' (cannot start with a number)
--The rest: numbers, letters, underscores, ' $ ' (-NO)
java keyword (reserved word)
The Java language has 51 keywords and cannot use reserved keywords to name classes, methods, or variables
Data type
boolean int long short byte float double Char class interface
Process Control
If else do and for switch case default break continue return try Catch finally
Modifier
Public protected private final void static STRICTFP abstract transient synchronized volatile native
Operation
Package import throw throws extends implements this super instanceof new
Other
True false NULL Goto const
Import Other projects
Import->general->existing Projects into workspace
Select the extracted project catalog->finish
Java Primary knowledge