package com.sky.entity;
public class MyThread {
public static void main(String[] args) {
MyThread1 thread = new MyThread1();
thread.start();
}
}
class MyThread1 extends Thread {
public void run(){
try {
System.out.println("Thread is running");
Thread.sleep(5000);
synchronized (this) {
System.out.println("Thread once more running");
this.notify();
}
this.stop();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}