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

how do you do the parseInt strategy correctly? can anyone give me an example?

My workspace worked perfectly. Now I am on a challenge, and it just wont work.

1 Answer

Benjamin Larson
Benjamin Larson
34,055 Points

Hi Jackie, are you on this Code Challenge: https://teamtreehouse.com/library/java-basics/perfecting-the-prototype/parsing-integers-2 ?

If you can use "Get Help" button the challenge it helps give us a better context of the problem :) Also, if you post the code you've tried, it helps as well.

If this is the problem you are on, it should look something like this:

String answerToLife = "42";
int answer = Integer.parseInt(answerToLife);

That is how I did it. Maybe I'm just missing something.