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 trialVictor Börjesson
510 PointsHow can we compile before a point is created?
When we write the method in Map
public bool OnMap(Point point) { } Without creating a point in Main() how come we can compile it?
Is there already a point? I'm confused
1 Answer
Steven Parker
231,198 PointsIn this method declaration, you're just indicating that the method will accept a Point object as an argument (and refer to it with the name "point"). Since you're only defining the method here, and not calling it, you don't need an actual Point object yet.
Victor Börjesson
510 PointsVery helpful!
Andrew Day
1,389 PointsAndrew Day
1,389 Pointsyou're declaring the variable point inside of your ( ). Point is a class that we defined in Point.cs. so Point point defines point as the name of your variable. the same would happen if you said Point fred.