Deadlock condition:

(1) Mutually exclusive use, that is, when a resource is used (occupied) by one thread, other threads cannot use it. (2) Non-preemption, the resource requester cannot forcibly seize resources from the hands of the resource possessor, resources can only be released by the initiative of the resource possessor. 3. Request and hold, that is, when the resource requester requests other resources while maintaining the possession of the original resource. 4. Cyclic waiting, that is, there is a waiting queue: P1 occupies P2 resources, P2 occupies P3 resources, and P3 occupies P1 resources. This creates a waiting loop.

Set correlation:

ArrayList: Load factor: 1, 1.5 times + 1 Default capacity 10

HashMap: Load factor: 0.75, 2 times default capacity 16

HashSet: Load factor: 0.75, 2 times the default capacity 16

SparseArray: not more than 4, expand to 8, greater than directly double

Design patterns

BitMapFatory: Factory mode

Lifecycle: Observer mode

Rxjava OKHttp: chain of responsibility

Context: Decorator pattern

Adapter: Adapter mode

AlertDialog: Constructor pattern.

Layoutinfler. from () : Windows ManagerGlobal singleton mode

A static variable

There cannot be any static variables and methods in a member inner class;

The member inner class is attached to the enclosing class, so the inner class can only be created if the enclosing class is created first.

Final: modifiers of variables, classes, and methods. Classes modified by final cannot be inherited, and variables or methods modified by final cannot be modified or overridden.

Finally: Exception handling provides a finally block to perform cleanup operations, where the code is executed whether or not an exception is thrown. If a try block contains a return statement, the finally block is run after a return.

Finalize: A method defined in the Object class. If a subclass overrides a Finalize () method, the method will be executed to determine whether the Object will be collected before the garbage collector clears the Object from memory