pass a variable as parameter to constructor c# [closed]
Closed 9 years ago.
pass a variable as parameter to constructor c# [closed]
Closed 9 years ago.
pass a variable as parameter to constructor c# [closed]
Closed 9 years ago.
pass a variable as parameter to constructor c# [closed]
Closed 9 years ago.
pass a variable as parameter to constructor c# [closed]
Closed 9 years ago.
Assigning to fields in function or by function?
While writing the constructor for class A
in Python, I calculate some of the class’s fields using function fun()
. This function is never used outside the constructor of instances of this class.
In situations like these, I tend to write fun()
so that it returns the desired values and then I assign these values in the initialization, like so: