Why Java cannot find my constructor?

Posted by Roman on Stack Overflow See other posts from Stack Overflow or by Roman
Published on 2010-03-16T14:32:07Z Indexed on 2010/03/16 14:36 UTC
Read the original article Hit count: 159

Filed under:
|
|
|

Well, maybe it is a stupid question, but I cannot resolve this problem.

In my ServiceBrowser class I have this line:

ServiceResolver serviceResolver = new ServiceResolver(ifIndex, serviceName, regType, domain);

And compiler complains about it. It says:

cannot find symbol
symbol : constructor ServiceResolver(int,java.lang.String,java.lang.String,java.lang.String)

This is strange, because I do have a constructor in the ServiceResolver:

public void ServiceResolver(int ifIndex, String serviceName, String regType, String domain) {
        this.ifIndex = ifIndex;
        this.serviceName = serviceName;
        this.regType = regType;
        this.domain = domain;
    }

ADDED: I removed void from the constructor and it works! Why?

© Stack Overflow or respective owner

Related posts about java

Related posts about constructor