Hi all,
In the book I read there is a function definition like this:
public override bool Equals(object obj)
{
if (!(obj is Point2))
{
return false;
}
return this == (Point2) obj;
}
but I do it like this:
public override bool Equals(object obj)
{
if (obj is Point2)
{
return this == (Point2) obj;
}
return false;
}
I know they are all the same, but is there a particular reason to go with #1?
Thanks!
2007-03-23
06:26:33
·
3 answers
·
asked by
Léon
1
in
Computers & Internet
➔ Programming & Design