35 lines
871 B
Java
35 lines
871 B
Java
package SingletonClasses;
|
|
|
|
public class MultiThreads {
|
|
public static void main(String[] args) {
|
|
|
|
|
|
Runnable tast = () -> {
|
|
LogManagement.FuncLog().Logs();
|
|
};
|
|
Thread thread1 = new Thread(tast);
|
|
Thread thread2 = new Thread(tast);
|
|
Thread thread3 = new Thread(tast);
|
|
Thread thread4 = new Thread(tast);
|
|
Thread thread5 = new Thread(tast);
|
|
Thread thread6 = new Thread(tast);
|
|
|
|
thread1.start();
|
|
thread2.start();
|
|
thread3.start();
|
|
thread4.start();
|
|
thread5.start();
|
|
thread6.start();
|
|
try{
|
|
|
|
thread1.join();
|
|
thread2.join();
|
|
thread3.join();
|
|
thread4.join();
|
|
thread5.join();
|
|
thread6.join();
|
|
}catch (InterruptedException e){
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
} |