In Java, if I have an interface:
public interface MyInterface{
}
Then MyInterface implementation is:
class MyC
You are correct. An interface may not specify a constructor, the constructor gets specified in the class that implements the interface.
public interface Foo {
public void doSomething();
}
public class Bar implements Foo() {
public Bar(int value) {
}
@Override
public void doSomething() {
}
}
then when you want to use your interface you need to do something like
Foo foo = new Bar(2);