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
In order for the thread to be able to set the static value, the class must be loaded. In order for the class to be loaded, the thread must end (so that the static block completes). That's probably why you have a deadlock.