title: why we use set method
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1461598/what-is-the-point-of-setters-and-getters-in-java">What is the point of setters and getters in java?</a>  </p>
  </blockquote>
  
  
  
  <p>I have a question about set method. Please provide some details if possible.
  I want to know why do we use set method with class name.</p>
  
  <pre><code>public class Mymainclass {
  
  Private class ClassC {
  
  Private Mysecondclass sec = null;
  
  public void setMymainclass(Mysecondclass second){
  
          Mymainclass.sec= second;
       }
     }
  }
  </code></pre>
  
  <p>Is it just setting the sec variable value ? if yes why there is class name with set? </p>