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

Java Java Objects (Retired) Delivering the MVP Validation

Static class method vs declared class method?

So in this section, the instructor is making this character "letter" lowercase using the following:

letter = Character.toLowerCase(letter);

My question is whether or not Is this functionally any different from using:

letter = letter.toLowerCase(letter);

Kinda curious if it can reassign itself using it's own method here

1 Answer

I am assuming letter is a char. This is one of the Java primitives, not an object, so it has no member functions to invoke.

Character class wraps the primitive type char into a char object on which you can invoke methods.