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 trialWilner Charles
Front End Web Development Techdegree Student 1,295 Pointsint answer = Integer.parsInt(answerToLife);
I've been stuck here for days please someone help me and tell me what I am doing wrong...
int answer = 35;
int answer = Integer.parsInt(answerToLife);
1 Answer
christopher vaughan
1,411 Pointstwo things ( maybe 1)
1) you don't show the declaration of answerToLife. If you just left that line off, then ignore this. otherwise add that back in.
2) in the second line you misspelled parseInt(parsInt) & you are redeclaring the variable with that second int declaration. see corrected code below:
String answerToLife = "42";
int answer = 35;
answer = Integer.parseInt(answerToLife);
Craig Dennis
Treehouse TeacherCraig Dennis
Treehouse TeacherAre you still stuck or did christopher vaughan help? If so, please make sure you click the best answer so that he gets the points he deserves! Thanks!