8 Replies Latest reply: Nov 20, 2006 7:09 PM by 807607 RSS

    static and non-static Synchronized methods - difference.

    807607
      My Understanding : If a static method is synchronized, then only one static synchronized method in the class will be accessible at any point of time to the threads. So if there were two threads and one of them is accessing a non-static synchronized method, and the other is accessing a static synchronized method, both threads should comfortably have access to those methods.

      Other statement : If a static synchronized method is accessed by a thread, then even non-static synchronized methods are not available to other threads.

      Which one is true of above 2 statements, if u could give an example and explanation to above query. Also, If someone gives the difference between static and non-static Synchronized methods. Thanks all.