Hi,
Is it better to write properties before methods in an interface Is there a optimal or preferred order for this and classes Like:
class def
{
properties
constructors
public property methods
methods
etc
}
Thanks,
aw
Hi,
Is it better to write properties before methods in an interface Is there a optimal or preferred order for this and classes Like:
class def
{
properties
constructors
public property methods
methods
etc
}
Thanks,
aw
To be honest I do it like you too. Ijust wrote the above because that is what the book does, sometimes.
Thanks,
aw
Thanks guys!
Btw Peter what did you mean with data (before private types)
So Matthew your order is like this :
public properties
private properties
public methods for private properties
constructors
methods
Also where do you guys put overriding standard methods, like ToString()
Thanks,
aw
Thanks Peter. Are fields and properties the same thing Because it seems to a little confusing to me.
Thanks again,
aw
No, fields are the data members (i.e. not methods, or properties.). Properties are technically implemented as methods.
Azurewrath wrote:
Thanks Peter. Are fields and properties the same thing Because it seems to a little confusing to me.
Thanks again,
aw
Thanks Peter. So are they like this:
private int intCount = 5
If not, can you please give me an example
Thanks,
aw