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 trialmichaelconnolly
848 PointsGetting an error.
I'm getting this error with a ^ over the a in answerTolife. Any suggestions? Thanks.
int answer = Integer.parseInt(answerToLife);
2 Answers
Axel McCode
13,869 PointsHi Michael! Your code doesn't seem to have any errors. My guess is that you have deleted the line of code above the line of code you have posted above. Here are the two lines of code I used for this challenge. I have tested them and they work. Hope this helps :)
String answerToLife = "42";
int answer = Integer.parseInt(answerToLife);
michaelconnolly
848 PointsThanks, I got it working. Thanks again.
Chris Shaw
26,676 PointsChris Shaw
26,676 PointsHi michaelconnolly,
Try the challenge again as I just tried your code and it worked fine.