c# - Does it make any practical difference to instantiate an object inside the constructor? -
this question has answer here:
is there practical difference between 2 ways of instantiating object?
public class myclass { private mytype myobject = new mytype(); }
and
public class myclass { private mytype myobject; public myclass() { myobject = new mytype(); } }
thanks helping.
no there isn't practical difference, between 2 ways provided. exaclty same.
Comments
Post a Comment