c# - Does it make any practical difference to instantiate an object inside the constructor? -


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

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -