Skip to main content

Difference between wait (), notify () and notifyAll ()

Wait , notify and notifyAll is one of the very much required object class methods required for inter Thread communication.

wait () method is responsible of releasing the lock on shared resources where as on the other side notify () and notifyAll () methods are responsible for notify the waited Threads to start consuming the lock again.

Comments

Popular posts from this blog

Sorting an List in Java

// Create a list String[] strArray = new String[] {"z", "a", "C"}; List list = Arrays.asList(strArray); // Sort Collections.sort(list); // C, a, z // Case-insensitive sort Collections.sort(list, String.CASE_INSENSITIVE_ORDER); // a, C, z // Reverse-order sort Collections.sort(list, Collections.reverseOrder()); // z, a, C // Case-insensitive reverse-order sort Collections.sort(list, String.CASE_INSENSITIVE_ORDER); Collections.reverse(list); // z, C, a

Hibernate

Best sites which are very much useful for assist in Hibernate related problems * Hibernate main site * Hibernate Tutorial * Hibernate Forum * Hibernate Wikipedia * Popular Hibernate Books * Hibernate Materials * Relational Persistence for Idiomatic Java