Java Java Basics Perfecting the Prototype Parsing Integers

nickolas riley
nickolas riley
5,441 Points

Getting syntax error on Integer.parserInt(answerToLife); ^

Thanks for the help

ParsingInts.java
String answerToLife = "42";
int answer = Integer.parserInt(answerToLife);

2 Answers

You just misspelled the method. It should be 'parseInt' not 'parserInt':

String answerToLife = "42";
int answer = Integer.parseInt(answerToLife);
nickolas riley
nickolas riley
5,441 Points

Thank you, I noticed the misspell as soon as I posted the question