Byte 1 bytes
Shot 2 bytes
int 4 bytes
Long 8 bytes
byte a = 1;
A = a+3;/is prone to loss of precision at compile time because 3 is of type int. In the conversion, the precision of the transition to a large precision.
Characters Char and number are automatically converted to the format when they are performed, and the operation is the value of the Asics of the corresponding characters.
The difference between a++ and ++a
Eg:int a = 1,b;
b = ++a;//The value of B is 2, meaning that the value of a is first added and then assigned to B
b = a++;//this time B has a value of 1,a and a value of 2 indicates that the value of a is first assigned to B and then added.
If the assignment is not made: a++ and ++a are basically the same.
&& does not continue when there is a satisfaction. & to determine that two conditions are met at the same time.
| Both operations on both sides, | | When true on one side, the following operation is no longer performed.
Left-shift operator << features: Multiply by 2 and multiply by several times. If the 6*2=12 is changed to 6<<1=12, the efficiency of the left shift operation is the same as high. However, its limitation is that it can only operate in multiples of 2.
The same right shift is the same, the corresponding number of binary to the right to move the corresponding number of bits, remove the deletion, left empty out of the complement 0. 6>>2=1,6/2^2=1. Shift right is the power of dividing by 2.
>>: Shift right, highest bit 0. The top 0 after the right shift, the highest bit is 1, and the right shift is 1.
>>>: Unsigned Right shift, no matter the highest bit is 0 is 1, the right shift after the vacancy is 0.
The ternary operator, the condition is true, executes the front, the condition is false, and the execution is followed. The ternary operator is a shorthand for ifelse. To abbreviate, if else execution must have a result, and if no result appears, such as if the statement is an output function, you cannot use the ternary operator shorthand.
Java format and operators