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 look to the Internet for assistance in figuring out how to retrieve an integer from a String.
Additional Reading
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
We already know how to prompt the user
for input, right?
0:00
We've done that before.
0:00
But there's a small problem.
0:02
The method we've been using,
readLine, always returns a string.
0:04
And as we learned, when working with
numbers, we want to use the int data type.
0:08
So how do we get an int from a string?
0:13
Let's ask the internet.
0:16
Okay, I'm going to ask Dr.
0:18
Google here, Java,
get an int from a string.
0:20
That one says also
0:28
containing letters,
so let's keep going down.
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