Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Java Basics!
You have completed Java Basics!
Preview
In this video, we will "listen" to the user by accepting input from the keyboard. We will then use this input to dynamically change our output to the screen.
Resources
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
Let's make our program
listen to what the user types in, too.
0:00
Up until now, we've only done output,
showing text on the screen.
0:01
Now we'll add input, which means
getting information from the user,
0:05
specifically from the keyboard.
0:08
Let's go back to our workspace
and learn how to take input.
0:10
Right now,
our variable firstName is fixed.
0:15
It's hard-coded
with a specific value.
0:18
Let's make it more flexible
by asking the user for their name instead.
0:20
Remember how I said that objects Console
have methods that let them take actions?
0:24
So far we've used only one method, printf,
which prints text to the screen.
0:29
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up