Tony Johansson wrote:
Hello!
I have noticed that you can write this override in two different ways.
You can either write in this way
public override string ToString()
{
return something;
}
OR IN THIS WAY
override public string ToString()
{
return something;
}
Is this two way exactly the same thing?
Which way is the recommnended way?
//Tony
Hi Tony,
If you're a native English speaker, it seems logical to say: "override
public string", since you are going to "override" the method signature that
follows. However, I *always* without question use "public override string"
because it maintains a standard throughout my code, i.e. the method
signature begins with a scope, then any modifiers, then it's return type.
I reccommend the first.
--
Hope this helps,
Tom Spink