Java Java Basics Perfecting the Prototype Parsing Integers

Anders Pedersen
Anders Pedersen
734 Points

Create a new int variable that is named answer. Store the integer version of answerToLife in it. I cant find the answer.

Code that was already made: String answerToLife = "42";

My answer: Int answer = Integer.parseInt(answerToLife);

I can't find the right solution.

ParsingInts.java
String answerToLife = "42";
Int answer = Integer.parseInt(answerToLife);

2 Answers

Steve Hunter
MOD
Steve Hunter
Treehouse Moderator 57,561 Points

Hi there,

The keyword int has a lowercase i.

Steve. :smile: :+1:

Anders Pedersen
Anders Pedersen
734 Points

Thanks for the help! :)

Felix Timothy
Felix Timothy
3,061 Points

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