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?
delete void from signature
public ServiceResolver(int ifIndex, String serviceName, String regType, String domain) {
this.ifIndex = ifIndex;
this.serviceName = serviceName;
this.regType = regType;
this.domain = domain;
}
You have defined a method, not a constructor.
Remove the void
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With