First of all in their own mind can appear in the knowledge of a list, followed by detailed expansion.
1.java environment variable, Java_home,path: $JAVA _home/bin
2.java basic Data type: Byte,boolean,char short,int,long,float,double.
3.String is the final modified immutable class, string is suitable for the key value of map, it is born with a hash value. The class that constructs the string has Stringbulder and StringBuffer, commonly used methods are append () and ToString () , the latter is synchronous, thread-safe, but less efficient.
The creation of 4.Java objects can be obtained by new or clone or by reflection.
5. Class loading, Bootstrapclassloader,extensionclassloader, and application ClassLoader that is, user-defined class loading, that is, class loading in classpath. The parent delegate, the Java class load, first uses the parents class, and if the parent class is not loaded, it will load itself.
6. The new object is in heap memory, and the object's reference is stored in the stack, pointing to the object in the heap. New objects in the green age, large objects are placed directly into the old age. Object GC, reference counting, and accessibility analysis to determine whether an object can be recycled. In addition, the GC algorithm has a mark-clear method (labeled and then clear, resulting in sparse space in the heap, various idle areas), the replication method (which requires half the space to be used for replication), the labeling method (which then moves to the edge of the heap, and then the unified recycling), partitioning method (different recovery algorithm for different regions). Mark Clear or Mark collation suitable for the age of youth, and the copy method for the old age, the young generation of the GC is not recycled objects will be transferred to the old age, space can be divided.
7.Java collection framework, the top-level interface of the collection is Collection,set (the elements in the collection cannot be duplicated), the queue, and the list are respectively inherited Collection.set have HashSet (nullable), Linkedhashset, etc. List has Arrarlist,vector and LinkedList, which also have linear table tables, thread-safe and non-thread-safe points. Another key is that Map,map has HashMap (nullable), Hashtable (not NULL, thread safe), Linkedhashmap and Concurenthashmap (segmented Hashtable) (Advanced, Concurent package),
8.Java interfaces and abstract classes. A class with abstract methods is an abstract class, and inheriting an abstract class must implement an abstract method of the parent class, and the non-default method in the interface is all abstract, and the property defaults to the static final type, and the implementation interface must implement all of its abstract methods.
9.Java multithreading, implements the Runable or callable interface, the latter has a return type, can also directly inherit the thread class, using the Start () method, run () will only perform operations without opening a new thread.
10. Thread synchronization, synchronized decoration method or code block, implement internal lock. Reentrantlock, synchronous lock, can be more than a lock, but remember to release, get a few times to unlock () several times. Semaphone, the semaphore, can limit the number of threads accessed by the method, each access to get the semaphore, and then release ().
Thread communication can be implemented through Synchronized,while polling and wait/notify. Multithreading is programmed to pay attention to deadlocks.
11.Volatile modified variables have multi-threaded visibility, direct read memory, have a certain synchronization effect, CAS (Compareandset) atomic operations; ThreadLocal, as the name implies, its modified variables are duplicated in each thread. becomes a variable that is used independently by each thread and does not have thread sharing.
12. Iterator iterator, commonly used is while (I.hasnext ()) {
Func (I.next ());
}
13.for,while,do...while, three ways to cycle. Break and continue.
14.switch case, it is now possible to switch the string to a choice.
15.error exception, can be captured, but the general error is not captured, exception selective capture, some runtimeexception can be properly thrown
16. Array ... Array out of bounds problem
17.TimerTask
18. Date operation, Dateformat,calendar
19.nio,socket
20. Generics and Java Reflection.
Java Learning Summary