I was just trying to create a Thread in a static block in Java that caused a deadlock to occur. The code snippet is as follows.
static
package deadlock; f
if you comment out
try { t.join(); } catch (InterruptedException e) { System.out.println(e.getMessage()); }
deadlock will not occur...Your thread will run after class load.