I want to call constructor inside the class like:
public class Myclass(){
public MyClass(){
//......
}
public MyClass(int id):this(){
//......
}
private void Reset(){
//.....
this = new MyClass(id); //here I want to call constructor
//......
}
}
but it is not working. Is it possible and how can I do it if Yes?
You can’t. But what you could do is split the constructor logic into an Initialize method that then reset could call.