A: Java Basic program Design structure:
1.1 data types
in Java, there are 8 types of data, including 4 integers, 2 floating-point types, 1 character types (char), and 1 Boolean types.
Integral type: int short long byte
Floating-point type: float double (double is twice times the dual precision of float)
Character type: char (used to represent a single character)
Boolean type: True and False (used to determine the logical condition, cannot be converted between an integer value and a Boolean value)
1.2 variables
when a variable is initialized, after declaring a variable, the variable must be displayed initialized with an assignment statement, never using a variable that is not initialized.
The declaration of a variable is as close as possible to the place where the variable was first used, which is a good programming habit.
If the constant is modified by the keyword final, it will not be able to be changed once the value is assigned. You can use the keyword static final to set a class constant, which is typically outside the class.
1.3 operator
in Java, you can also use the arithmetic operator +,-,*,/operation.
The increment operator and the decrement operator (such as n++ self-add 1,n--1).
Relational operators and Boolean operators: use two = = to detect equality! = detection is not equal.
bitwise operators: When working with integer values, you can directly manipulate the number of bits that make up an integral type.
Mathematical Functions and constants
Java SE Knowledge Point Summary