i am going through oracle docs for deadlock.. i found this code
public class Deadlock { static class Friend { private final String name;
in the end of bow A and G call bowBack, leading to a call of G.bow from A and a A.bow from G while bow of A and G is synchronized. So so they both wait for each other to finish.