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 Meet Objects Welcome Back

John Loön
John Loön
839 Points

String.loweredWords

Hi! When Craig is gonna show the "String.loweredWords = someWords.toLowerCase", at 5.05 I don't get what he's doing. He just makes the rest of the text appear and quickly says something about ”When there is multiple options there so it’s gonna show us”. I don't understand how the rest of the code appears!

4 Answers

John Loön
John Loön
839 Points

Hi and thanks for a quick answer! Yes I think I understand the thing as a whole (kind of). The specific problem is at the moment I mentioned when Craig is writing "String loweredWords = someWords.to...." and then after "to", where I made the dots, I’m guessing he tabs or something and this appears:"LowerCase(toLowerCase(" so the whole thing looks exactly like this:

"jshell> String loweredWords = someWords.toLowerCase( toLowerCase("

After that I guess he press Enter and jshell repeats this:

”jshell>String loweredWords = someWords.toLowerCase(”

How do I get this to appear?

I’m sorry if I’m explaining it bad but I’m really stuck and I just can’t seem to grasp how to follow in workspace!

BR John

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,252 Points

I'm not sure what system you're using to follow along, whether it's Workspaces, Terminal or Bash. I'm not sure how to replicate the behaviour he's using as I'm not sure what he's doing.

But it looks like he might be looking to see if the toLowerCase() method provides options that can be passed in. Since it looks like there is not it simply returned toLowerCase( to the screen.

Then to get back to the last command he simply pressed the up arrow on this keyboard to continue the command. Obviously you could also pass in a string to return that string as all lowercase.

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,252 Points

Craig is using the terminal in Workspaces to demonstrate some methods you can use on Strings.

he's doing this in jShell which is a kind of command line interface you can use with Java.

When you type commands in what you're seeing is feedback, a response by the commandline to what you have typed in.

For example it tells you if a method or expression evaluates to true or false. Have a go at the jshell like Craig does and you'll get a handle on the kind of troubleshooting you can do. :)

John Loön
John Loön
839 Points

Thanks a lot for your help and patience! I think I'm just gonna move on from this exercise and try the next one. Eventually my issue will appear again I guess and I can tackle it from another viewpoint. I'm really new to all of this with all the new terms and stuff and everything in english which is not my first language. I'll just keep on struggling! Thanks again! John

I have the same question. I cannot see what part he writes and what part pops up on the screen as a result of pressing enter. Help?