One of interviewer asked me this question: How to create instance of class that have parameterized constructor, but i will not send the parameter information. Example:
public class abc{
public abc(string str)
{
}
}
Now if we create instance of it then i have to do it in this way:
abc abcInstance = new abc("xyz");
But he wants that he will not pass parameter eg.:
abc abcInstance = new abc();
Please help me out. Some one suggested Dependency Injection Please share an example. Thanks in advance.