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 trialebrahem anwar
415 Pointsplease i don't understand the Question
Create a new int variable that is named answer. Store the integer version of answerToLife in it.
Bummer! There is a compiler error. Please click on preview to view your syntax errors! Preview Recheck work ParsingInts.java
1 String answerToLife = "42"; 2 int answar = Integer.parseInt("answerToLife");
String answerToLife = console.readLine("answerToLife");
int answar = Integer.parseInt("answerToLife");
2 Answers
Raymond Wach
7,961 PointsYou do understand the question correctly, but the problem is that your solution does not create a new int
variable named answer
. Your code creates a variable named "answ_a_r" and this does not pass the test for the question because it is looking for the literal name "answer" and not just an int
with the correct value.
mrben
8,068 PointsThe problem might be that you have int answar
instead of int answer
.