Created
December 12, 2018 14:33
-
-
Save kirugan/bde7e45de9ef273b85b2f07b84607489 to your computer and use it in GitHub Desktop.
Test java exception in multithread env
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Test { | |
public static void main(String args[]) throws InterruptedException { | |
Thread t = new Thread() { | |
public void run() { | |
System.out.println("Welcome new thread"); | |
throw new RuntimeException("Hey there!"); | |
} | |
}; | |
// try { | |
t.run(); | |
// } catch (Exception e){ | |
// System.out.println(e.getMessage()); | |
// } | |
t.join(); | |
System.out.println("OK"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment