For example:
Import the Java. Util. *;
Import the Java. Util. ArrayList;
Import the Java. Util. Scanner;
/* class shuru {
Public static void main (String [] args) {
Scanner sc=new Scanner (System. In);
System. The out. Print (" please enter the number of threads, and press enter to end ");
Int n=sc. NextInt ();
System. The out. Print (" please enter the number of papers, press enter to end ");
Int T=sc. NextInt (); }
} */
public class shareThread implements Runnable {
Public static void main (String [] args) {
Scanner sc=new Scanner (System. In);
System. The out. Print (" please enter the number of threads, and press enter to end ");
Int n=sc. NextInt ();
System. The out. Print (" please enter the number of papers, press enter to end ");
Int T=sc. NextInt (); }
//public static int n=10000;//the number of array digital
//public static int T=5;//the number of threads
Public static int [] ary=new int [n].
Public static int [] newAry=new int [n].//sorted array
//thread running
Public void the run () {
//System. Out. Println (ary [I]);
//System. Out. Println (Thread. The currentThread (). The getName ());
Synchronized (shareThread. Class) {
for(int i=1; I & lt;=T; I++) {
If (Thread. CurrentThread (). The getName () equals (" Thread "+ I)) {
Int [] newArray=work (I);
Int count=n/T * (I - 1);
for(int j=0; j
//System. Out. Println (+ + count);
//System. Out. Print (newArray [j] + "");
//System. Out. Println (newAry [count] + "");
count++;
}
}
}
}
}
This period of realization of the above the red?