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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Ronan Corcoran](https://secure.gravatar.com/avatar/802edbaf0c9c339808b8f06c0da3e2ca?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Ronan Corcoran
878 PointsWhy do some keywords like this.variableName have a dot while new ClassName has a space?
I'm unsure of why when creating an object we right it as PezDispenser dispenser = new PezDispenser();
instead of PezDispenser dispenser = new.PezDispenser();
I keep mixing up spaces and dots when using some keywords. I understnad that dots used for calling methods.
but why does this.characterName use a dot and not space.an inversly why is the keyword new follwed by a space and then the class name.
Thanks
Ronan
1 Answer
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,688 PointsYou nearly answered it yourself when you said "the keyword new". And since "new" is indeed a keyword and not a class instance, it is followed by a space. You do the same thing with other keywords like "class" or "return".
But when you write "this.characterName", "this" is a class instance. So the membership operator (the dot) is used to join it to the name of one of its fields (like "characterName").