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 trialChris M
592 PointsPoint point explination
I'm on the C# objects tutorial and I've having trouble understanding this:
Point point = new Point (4,2);
I know that
Point
is a class I made but I'm just not understanding the what
point
is there for.
1 Answer
Jennifer Nordell
Treehouse TeacherIt's the variable name of type point. It's going to hold your new point. You could have named it myPoint or yourPoint or really any valid variable name. For example:
Point point = new Point (4,2);
Point myPoint = new Point(5,7);
Point yourPoint = new Point (0,3);
This would create three Point objects and we'd reference them now by their names. Hope this clarifies things!
Chris M
592 PointsChris M
592 PointsAhhh, that makes more sense, Thanks a lot.