1. Sort the bitwise operations, especially the left and right shifts (with or without symbols) to your blog.
The emphasis is on the operation process of clear negative numbers.
/*
Class Demo {
public static void Main (string[] arge) {
int a =-4; 1111 1100
int B = a >> 2; 1111 1111
int B = A >>> 2 0011 1111
System.out.println (b);
}
}
*/
/* 2.byte to hexadecimal string representation programming principles and implementation methods are organized into blogs.
Class Demo {
public static void Main (string[] arge) {
byte A = 28;
byte low = (Byte) (A & 0x0f);
byte hight = (byte) ((A & 0xf0) >>4);
Char[] Array = {' 0 ', ' 1 ', ' 2 ', ' 3 ', ' 4 ', ' 5 ', ' 6 ', ' 7 ', ' 8 ', ' 9 ', ' A ', ' B ', ' C ', ' D ', ' E ', ' F '};
System.out.println ("0x" + array[hight] + array[low]);
}
}
*/
3. Define a function to calculate the and of all elements of an integer array.
/*
Class Demo {
public static void Main (string[] arge) {
Int[] array = {2,3,5,10};
int sum = 0;
for (int a=0; a<array.length;++a) {
Sum+=array[a];
}
SYSTEM.OUT.PRINTLN (sum);
}
}
*/
4. Copy of the array.
Class Demo {
public static void Main (string[] arge) {
Int[] array = {2,3,5,10};
int[] Arrayback = new Int[array.length];
for (int a=0; a<arrayback.length;++a) {
Arrayback[a] = Array[a];
}
for (int a=0; a<arrayback.length;++a) {
System.out.print (Arrayback[a] + "");
}
}
}
5. Heap memory default is 1/4,
----------------------------------------
JAVA-XMX//Set heap memory max
-XMS//Set heap memory initial value
ClassName//class name
A: The default maximum heap memory is 1/4 of physical memory, when running a Java program, you can-xms the initial heap memory size,-XMX set the maximum heap memory size;
Ava Foundation Fourth day