Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class XxxMain {
- private XxxMain() {}
- /**
- * Main.
- *
- * @param args args.
- */
- public static void main(String[] args) throws InterruptedException {
- Thread t1 = new Thread(new Thread1());
- t1.start();
- t1.interrupt();
- System.out.println("Finished");
- System.out.println(t1.isInterrupted());
- System.out.println(t1.isAlive());
- }
- }
- class Thread1 implements Runnable {
- @Override
- public void run() {
- try {
- while (true) {
- int x = 2 +2;
- }
- } finally {
- System.out.println("finally executed");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement