One
An enumeration type is a reference type, and the enumeration does not belong to the original data type, and each of his specific values refers to a specific object. The same value refers to the same object.
You can use the ' = = ' and Equals () methods to directly compare the values of the enumeration variables, in other words, the result of the "= =" and the Equals () methods are equivalent for variables of the enumerated type.
Two
Each variable has a corresponding scope and leaving this scope variable will no longer be valid. Two scopes have different names for the same variable, and do not cause conflicts.
public
class
qq {
private
static
int
code=
24
;
public
static
void
main(String[] args) {
int
code=2
;
System.out.println(code);
}
}
The result of the output is 23.
byte: 1 bytes -128~127
Short: 2 bytes -2^15~2^15-1
int: 4 bytes -2^31~2^31-1
Long: 8 bytes -2^63~2^63-1
Boolean: 1 bytes True False (cannot be replaced in Java by 0 or not 0)
float: 4 bytes -3.403e38~3.403e38
Double: 8 bytes -1.798e308~-4.9E324
Char: 2 bytes ' \u0000 ' ~ ' \uffff ' (16 binary, converted to 0~65535) (1 bytes equals 8 bits) four
Output Result:
x+y=100200
300=x+y
Because +x+y indicates that only the values of X and Y are output, x+y represents the value of the output x+y.
Hands on the brain