Java Java Basics Perfecting the Prototype Parsing Integers

Unclear about the question. What am i doing wrong

int answer = 7;
int AnswerToLife = Integer.parseInt(answer);

1 Answer

Steven Mattia
Steven Mattia
1,698 Points

You changed answer to an int when it is supposed to be a String and you need to change AnswerToLife to the camel cased version: answerToLife.

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