ThreadTest Thread {
threadNo;
ThreadTest( threadNo) {
.threadNo = threadNo;
main(String[] args) Exception {
( i = ; i < ; i++) {
ThreadTest(i).start();
);
run() {
( i = ; i < ; i++) {
+ threadNo + + i);
ThreadTest2 Thread {
threadNo; String lock;
ThreadTest2( threadNo, String lock) {
.threadNo = threadNo;
.lock = lock; }
main(String[] args) Exception {
String();
( i = ; i < ; i++) {
ThreadTest2(i, lock).start();
);
run() {
(lock) {
( i = ; i < ; i++) {
+ threadNo + + i);
ThreadTest3 Thread {
threadNo;
String lock;
ThreadTest3( threadNo) {
.threadNo = threadNo;
}
main(String[] args) Exception {
( i = ; i < ; i++) {
ThreadTest3(i).start();
Thread.sleep();
}
}
abc( threadNo) {
( i = ; i < ; i++) {
System.out.println( + threadNo + + i);
}
}
run() {
abc(threadNo);
}
}
URL:http://www.bianceng.cn/Programming/Java/201608/50398.htm