title: Why java allows method that has class name and type void
body: <p>Java allows to create method which has the name of the class and type void ( Like void constructor). Constructor has no type and it do the function of the constructor. But is there any usage above mentioned kind of methods. Can you give examples of those usages</p>
  
  <p>Sample Code:</p>
  
  <pre><code>//my class
  class MyClass{
  
      //constructor
      public MyClass(.....){
      }
  
      //What is the use of the below method
      public void MyClass(....){
      }
  }
  </code></pre>