@@ -0,0 +1,956 @@
+class Deadlock%7B  %0A  public static void main(String%5B%5D args) %7B  %0A    final String resource1 = %22X%22;  %0A    final String resource2 = %22Y%22;  %0A    Thread t1 = new Thread() %7B  %0A      public void run() %7B  %0A          synchronized (resource1) %7B  %0A           System.out.println(%22Thread 1: locked resource 1%22);  %0A  %0A           try %7B Thread.sleep(100);%7D catch (Exception e) %7B%7D  %0A  %0A           synchronized (resource2) %7B  %0A            System.out.println(%22Thread 1: locked resource 2%22);  %0A           %7D  %0A         %7D  %0A      %7D  %0A    %7D;  %0A    %0A    Thread t2 = new Thread() %7B  %0A      public void run() %7B  %0A        synchronized (resource2) %7B  %0A          System.out.println(%22Thread 2: locked resource 2%22);  %0A  %0A          try %7B Thread.sleep(100);%7D catch (Exception e) %7B%7D  %0A  %0A          synchronized (resource1) %7B  %0A            System.out.println(%22Thread 2: locked resource 1%22);  %0A          %7D  %0A        %7D  %0A      %7D  %0A    %7D;  %0A  %0A      %0A    t1.start();  %0A    t2.start();  %0A  %7D  %0A%7D %0A

Create deadlock.java