Enumtest:
1. The enumeration type is a reference type.
2. system.out.println (S.getclass (). isprimitive ()); false size s=size.small; Size t=Size.LARGE; System.out.println (s==t) false ). The same value refers to the same object ( size u=size.valueof ("SMALL"); System.out.println (s==u); ).
3. You can use the "= =" and the equals () methods to directly compare the values of the enumeration variables, in other words, for variables of the enumeration type,"= =" and The result of the equals () method execution is equivalent.
Hands on Brain 2:
the output is: x+y=100200
300=x+y
System.out.println ("x+y=" +x+y); the meaning is to y Variables and x the value of the variable is printed as a string, so the result is x+y=100200
and System.out.println (x+y+ "=x+y"); is calculated first X+y value is then set to the value of the "=x+y" print them together as characters.
After-school exercises:
Binary representation of the number:
The original code: is the binary fixed-point notation, that is, the highest bit is the sign bit, "0" indicates positive, "1" represents a negative, and the remaining bits represent the size of the value.
Anti-code: The inverse code of positive number is the same as its original code, negative number of the inverse code is to its original code bitwise negation, except the sign bit.
Complement : The complement of a positive number is the same as its original code, the complement of negative is in its inverse code of the bottom plus 1 .
Scope of the variable:
The value of the output should be from the values of the nearest value of System.out.print (value) and will be written in public static void main (string[] args) {}.
Hands-on brain to learn Java