I know the interface is working. When I started coding in my project, I got this doubt in my mind. Can anyone clarify ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As I understand, you want to know why we can’t specify constructor’s signature as well as other object’s methods, like
It can’t be done because at first, all interface methods should be implemented as public but constructors can be set as private, and at second, method void App(..) will be constructor only for class App, for another class it will be another method.
So in common, if you want to specify constructor with known parameters, try to use abstract base classes.