title: why Synchronized method allowing multiple thread to run concurrently?
body: <p>I have following program in same file. I have synchronized the run() method.</p>
  
  <pre><code>class MyThread2 implements Runnable {
      Thread    t;
  
      MyThread2(String s) {
          t=new Thread(this,s);
          t.start();
      } 
  
      public synchronized  void  run() {
          for (int i=0;i&lt;3;i++) {
              System.out.println("Thread name : "+ Thread.currentThread).getName());
              try {
                  t.sleep(1000);
              }
              catch (InterruptedException e) {
                  e.getMessage();
              }
          }
      }
  }
  
  class TestSync {
      public static void main(String[] args) {
          MyThread2 m1=new MyThread2("My Thread 1");
          c.fun();
      }
  }
  
  class c {
      static void fun() {
          MyThread2 m1=new MyThread2("My Thread 4");
      }
  }
  </code></pre>
  
  <p>output is</p>
  
  <pre><code>Thread name : My Thread 1
  Thread name : My Thread 4
  Thread name : My Thread 4
  Thread name : My Thread 1
  Thread name : My Thread 1
  Thread name : My Thread 4
  </code></pre>
  
  <p>My question is why is synchronized method allowing both "My Thread 1" and "My Thread 4" thread access concurrently?</p>