Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void main(String[] args) {
- MyThread my = new MyThread();
- Thread thread1 = new Thread(new Runnable() {
- @Override
- public void run() {
- my.f();
- }
- });
- Thread thread2 = new Thread(new Runnable() {
- @Override
- public void run() {
- for (int i = 0; i < 100; i++) {
- my.test(i);
- }
- }
- });
- Thread thread3 = new Thread(new Runnable() {
- @Override
- public void run() {
- my.f();
- }
- });
- thread1.start();
- thread3.start();
- thread2.start();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement