Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Java Java Objects (Retired) Delivering the MVP Validation

Nick Vitsinsky
Nick Vitsinsky
7,246 Points

I'm lost with Character.isLeter(letter); letter = validateLetter(letter);

Hey, I'm lost with Character.isLeter(letter); letter = validateLetter(letter); From where did we take Character to apply isLetter to it? We never declare Character before. The same is to validateLetter. Are Character and validate something that exist in java on their own and we don't need to declare them? and if yes, in validateLetter - did we declare Letter anywhere before, or Letter is also exist in java without declaring it. Or maybe it is taken from private char validateGuess(char letter) and simply written in camelCase? Totally confused right now.

1 Answer

Q: "Are Character and validate something that exist in java on their own and we don't need to declare them?"

Character is a class in java.lang. One of its methods is isLetter().
https://docs.oracle.com/javase/7/docs/api/

validateLetter() was a mistake. The private method he wrote was validateGuess(). He admits the mistake around 10:44