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#

Chris M
Chris M
592 Points

Point 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
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

It'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! :smiley:

Chris M
Chris M
592 Points

Ahhh, that makes more sense, Thanks a lot.