Java Java Basics Perfecting the Prototype Parsing Integers

david vos
david vos
1,479 Points

i do not understand this question. I've tried everything and it is always giving syntax errors

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

2 Answers

Jennifer Nordell
Jennifer Nordell
Treehouse Staff

Hi there! You're doing fine, and your syntax is spot on, but you're trying to overwrite the value in answerToLife which was already declared. This will give a syntax error. The variable you make should simply be named answer. So if on the second line I change it from int answerToLife to int answer, your code passes the challenge!

Hope this helps! :sparkles: