Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package demo;
- public class ThreadDemo_Error {
- public static void main(String ... a){
- System.out.println("main 1");
- FakeWindow.doSomeThing();
- System.out.println("main 2");
- }
- static class FakeWindow {
- public static void doSomeThing()
- {
- new Thread(new RunableTemp()).start();
- }
- }
- static class RunableTemp implements Runnable{
- @Override
- public void run() {
- System.out.println("s1");
- try {
- Thread.sleep(3000);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- System.out.println("s2");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement