title: Unable to understand sync
body: <p>Hey I am trying to make 10 threads in a synchronized manner and I came up with the code below however I am not able to understand a part of it as mentioned below. I am still really new to java, I tried looking up synchronized threading from 
  <a href="https://www.javatpoint.com/multithreading-in-java" rel="nofollow noreferrer">Here</a>  but still I am clueless.</p>
  
  <pre><code>class question3 {
      public static void main(String arg[]) throws Exception {
          for (int i = 0; i &lt; 11; i++) {
              data di = new data();
              System.out.println(di.count);
  
          }
      }
  }
  
  class item {
      static int count = 0;
  }
  
  class data extends item implements Runnable {
      item d = this;
      Thread t;
  
      data() {
          t = new Thread(this);
          t.start();
      }
  
      public void run() {
          d = syn.increment(d);
      }
  }
  
  class syn {
      synchronized static item increment(item i) {
          i.count++;
          return (i);
      }
  
  }
  </code></pre>
  
  <p>I am not sure what this part of code does?</p>
  
  <pre><code>public void run() {
          d = syn.increment(d);
      }
  }
  
  class syn {
      synchronized static item increment(item i) {
          i.count++;
          return (i);
      }
  }
  </code></pre>