publicclassDeadLockDemo{ privatestaticObjectresource1=newObject();//资源1 privatestaticObjectresource2=newObject();//资源2 publicstaticvoidmain(String[]args){ newThread(()->{ synchronized(resource1){ System.out.println(Thread.currentThread()+"getresource1"); try{ Thread.sleep(1000); }catch(Interrup...