Guest User

Untitled

a guest
Dec 11th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. class thread1 extends Thread
  2. {
  3. public void run()
  4. {
  5. for(int i=0;i<=5;i++)
  6. {
  7. System.out.println("Status: "+isAlive());
  8. }
  9. System.out.println("Exit from Thread");
  10. }
  11. }
  12. class AliveJoinThread
  13. {
  14. public static void main(String args[])
  15. {
  16. thread1 t=new thread1();
  17. t.start();
  18. try
  19. {
  20. t.join();
  21. }
  22. catch(Exception e)
  23. {
  24. System.out.println("join method running");
  25. }
  26. System.out.println("New Status: "+t.isAlive());
  27. }
  28. }
Add Comment
Please, Sign In to add comment