Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. public class XxxMain {
  2.  
  3. private XxxMain() {}
  4.  
  5. /**
  6. * Main.
  7. *
  8. * @param args args.
  9. */
  10. public static void main(String[] args) throws InterruptedException {
  11. Thread t1 = new Thread(new Thread1());
  12. t1.start();
  13. t1.interrupt();
  14. System.out.println("Finished");
  15. System.out.println(t1.isInterrupted());
  16. System.out.println(t1.isAlive());
  17. }
  18.  
  19. }
  20.  
  21.  
  22. class Thread1 implements Runnable {
  23.  
  24. @Override
  25. public void run() {
  26. try {
  27. while (true) {
  28. int x = 2 +2;
  29. }
  30. } finally {
  31. System.out.println("finally executed");
  32. }
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement