Operator
(1) Arithmetic operators (+,-,/,%,++,- -,**),;
(2) Relational operators (>,<,>=,<=,–==,!=) ;
(3) Logical operators (&&,||,!);
(4) Bitwise operators (>>,<<,>>>,&,^,|,~);
(5) Assignment operators (= ,+=,-=,*=,/=);
(6) Conditional operator (?:);
(7) Other operators.
Character (string) addition
1. The use of addition symbols
2. The addition of normal numerical values
Increase and decrease
1. Use alone;
2. Mixed use with printing
Arithmetic and relational operators
< != >= <=
Logical Operators
Logical operators include: | |
---|---|
&& short circuit with | 1. Both sides are true, the result type is true 2. One side is false, the result type is false Short-circuit characteristics: the left side of the symbol is false, and the right side is no longer calculated |
Short-circuit and or | 1. Both sides are false, the result is false 2. One side is true, the result is true Short circuit characteristics: the left side of the symbol is true, and the right side is no longer calculated |
! Negate | 1.! The true result is false 2.! false result is true |
Note: Logical operator is used to connect two Boolean type result operators, the result of the operation is Boolean true or false
Conditional operator
a=5; unary operator;
5+3; binary operator
;? : Ternary operator;
Big Data 2003 Student ID: 2020080603020