Week 16, Java

Static void main public (Arge String []) {
String Striing new new STR = ( "ahello");
System.out.println:; ( "length" + str.length ())
character System.out.println ( "position : "+ str.charAt (0));
byte ARR [] = the getBytes STR ();
}
the set a set of similar jar, a plurality of elements may be thrown into the jar, but can not remember the order of addition element, and therefore does not allow It contains the same elements.
HashMap and TreeMap Map system are two commonly used test class, HashMap class that implements the Map interface is based on the hash algorithm.
Test class TreeMap Map interface is "tree" structure based on the stored
Java collections framework also provides two very useful auxiliary tools:
the Collections and Arrays

Multithreaded
process and thread is a control flow of
a process corresponds to a program typically
a program may be composed of a plurality of different threads.
Program: the use of a programming language development tools, static, did not start running until just an ordinary disk file
a thread may contain one or more threads, a thread is a thread of execution inside the program.
Multi-threaded applications in real work scenarios:
QQ chat (keyboard input and waiting)
to access the page (application server must be able to respond to multiple user requests)
to create a multi-threaded approach has two kinds:
inherited class Thread
achieve Runnable interface

Blocking
calls to give up sleep footprint
call blocking I / O method for
waiting for synchronization lock
waiting for a notification
call to suspend (suspend thread)

Unblock
waiting for sleep end of the
I / O method returns
obtained Genlock
notified
resurne

Guess you like

Origin blog.51cto.com/14589620/2460821