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# C# Objects Methods Return Values

Jose Perez
Jose Perez
1,338 Points

if created an object name x instead of point can it still pass thru OnMap(Point point), or must object name match?

Is Point point declaring variable? If so, is correct to say that point of type Point is the same as saying point of type coordinate? The created Type (Point) is actually a type coordinate?

1 Answer

Hello!

No, the variable name doesn't have to match. You can use any name you'd like.

is correct to say that point of type Point is the same as saying point of type coordinate?

Not quite. It is quite the opposite. You can declare it like this and it will work:

Point coordinate = new Point();

// but the following won't work since there's no Coordinate class (or object) declared so far.
Coordinate point = new Coordinate();

Hope it helped!