title: Why Java cannot find my constructor?
body: <p>Well, maybe it is a stupid question, but I cannot resolve this problem.</p>
  
  <p>In my <code>ServiceBrowser</code> class I have this line:</p>
  
  <pre><code>ServiceResolver serviceResolver = new ServiceResolver(ifIndex, serviceName, regType, domain);
  </code></pre>
  
  <p>And compiler complains about it. It says:</p>
  
  <pre><code>cannot find symbol
  symbol : constructor ServiceResolver(int,java.lang.String,java.lang.String,java.lang.String)
  </code></pre>
  
  <p>This is strange, because I do have a constructor in the ServiceResolver:</p>
  
  <pre><code>public void ServiceResolver(int ifIndex, String serviceName, String regType, String domain) {
          this.ifIndex = ifIndex;
          this.serviceName = serviceName;
          this.regType = regType;
          this.domain = domain;
      }
  </code></pre>
  
  <p><strong>ADDED:</strong>
  I removed <code>void</code> from the constructor and it works! Why? </p>