Method 1:
1 int A = 3; 2 int B = 5; 3 A = a + B; 4 B = A-B; 5 A = A-B;
Disadvantage: If a and B are large numbers, they may overflow easily.
Method 2:
Int A = 3; int B = 5; A = a ^ B; B = a ^ B; A = a ^ B;
"^" Is an exclusive or operation, so there will be no overflow problem.
00000011 ^ 00000101 equals 00000110
00000110 ^ 00000101 equals 00000011
1. String string + = "ASD ";
The Java compiler will create a new stringbuffer object, convert string into stringbuffer, and then call the append () method and add "ASD ". Convert tostring to the string type.
2. This is the object for obtaining the current call method.
3. Random random = new random (peed); peed is a seed. Different seed produces different random numbers. The same seed produces the same random number when the same number of random times,
Math. Random (); is to call the random method.
Exchange Values and notes with only two variables