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 Java Basics Perfecting the Prototype Parsing Integers

please 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");

ParsingInts.java
String answerToLife = console.readLine("answerToLife");
int answar = Integer.parseInt("answerToLife");

2 Answers

Raymond Wach
Raymond Wach
7,961 Points

You 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.

The problem might be that you have int answar instead of int answer.