Other points to note when computing in Java
class Arimetic
{
public static void main(String[] args)
{
short x = 10;
s1++; //或者是++s1
System.out.println(s1); //此时输出的结果为11,特别注意的是,此时s1的数据类型并 没有改变,仍然是short的基本数据类型
}
}
3
7.
8.
-
-
The underlying binary of the computer is in the form of complement, so in bit operation, the complement of the number is actually calculated, but when it is converted from binary to decimal, it is converted from the original code. , And the highest bit 1 of the negative original code is not involved in the conversion calculation, it just represents a negative sign.
-
Combination of assignment and ternary operation.
-
In the if...else statement, only one statement will be executed.