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 trialTeacher Russell
16,873 PointsPrompter.java
Are we using charAt(0) on the guess input in case the player enters more than one character? This video does cover a lot without explaining it very well. Also, I thought i got "this" in this kind of situation, but let me get this straight. "this.game" inside the Prompter constructor is referring to the private variable up top, and "game" on the other side of the equals refers to the parameter?
1 Answer
Brendon Butler
4,254 PointsYes.
And to your second question. Yes. this
always refers to the class level variable.
Teacher Russell
16,873 PointsTeacher Russell
16,873 PointsThank you Mr Butler. I read something that made me think I was confused. No worries. Much appreciation.