1, ordinary class methods can be the same name as the class names, and the construction method is the only distinction is that the construction method does not return a value
2, string[] ss = new STRING[10]; Ss.length = 10; A[0]~A[9] = null
int[] ss = new INT[10]; Ss.length = 10; A[0]~A[9] = 0
3. thread is divided into daemon thread and non-daemon thread (i.e. user thread)
The daemon thread works as long as any non-daemon threads in the current JVM instance do not end;The daemon thread ends up working with the JVM only when the last non-daemon thread ends. the most typical application for daemon threads is the GC (garbage collector) 4, volatile keyword used in multi-threaded synchronization, can guarantee the visibility of the read, can not guarantee thread safety 5, there is the number of I + 1 < I, that is, when I is an int type and I is the maximum value, 2^32-1, i+1 will overflow into negative 6, the inputstream (input)/outputstream (output) is the suffix of the byte stream; The word stream is suffixed with reader (input)/writer (output) 7, about the bit operation in Java, the right shift 1 is equivalent to 2, the left Shift 1 is equivalent to multiply 2
int i = ten; //2 binary: 1010 System.out.println (i << 1); // output 20, left 1 digits after: 10100=20 System.out.println (i << 2); // output 40, left 2 bit after: 101000=40//// Output 2, right to move 1 bit after: 0010=2
20160215
1. The order in which the static variables of a class is assigned is executed in the order in which the code is written.
2, the Java reflection mechanism is in the running state, for any class, can know all the properties and methods of this class, for any one object, can call any of its methods and properties; This dynamically acquired information and the ability to dynamically invoke the object's methods are called the reflection mechanisms of the Java language.
JDK Source view
Spring Source, etc.
Java Learning notes Record