JAVA
java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
public class Program
{
class A implements Runnable{
void run()
{System.out.println("hey");
}
}
public static void main(String[] args){
Thread test = new Thread (new A());
A.start;
try {
test.sleep(1000);
} catch ( InterruptedException e) {
System.out.println("Error while calling sleep thread");
}
A.start;
}
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run