Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MyClass extends Thread {
- public static void main(String[] args) {
- MyClass thread1 = new MyClass() {
- @Override
- public void run() {
- System.out.println("Task1");
- }
- };
- MyClass thread2 = new MyClass() {
- @Override
- public void run() {
- System.out.println("Task2");
- }
- };
- thread1.start();
- thread2.start();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement