How does java require that all classes that implement interfaces must have a constructor whose input parameter is Class B?

how does java require that all classes that implement interfaces must have a constructor whose input parameter is class B?

the code is as follows:

public interface VO {
    VO(DTO dto);
}

write an error like this:

error:Not allowed in interface

but what should I do if I have such a need? Or can"t I have such a need, or shouldn"t I have such a need?

Jun.04,2021

API can have classloader and class instances, but there are no objects. The reason is that there is no construction method. In this case, how to limit
you explain the business clearly and see if there are any other possible solutions?

Menu