Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C# Intermediate C# System.Object Object.Equals

David Dzsotjan
David Dzsotjan
5,929 Points

Why not setting the argument of Equals to Point straight away at the override?

Wouldn't we circumvent the type checking and type casting inside the overriden Equals method (for the Point class), by typing public override bool Equals(Point that) ? Or do we have to put in a general object since Equals is the method for completely general objects?

1 Answer

Steven Parker
Steven Parker
229,644 Points

An override must conform to the calling signature of the original, which means it must take the same number and type of arguments and return the same type.

David Dzsotjan
David Dzsotjan
5,929 Points

Thank you, it is clear now :)