Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Java Basics Perfecting the Prototype Parsing Integers

Craig Galbraith
Craig Galbraith
283 Points

Stage 3 Perfecting the Prototype Challenge 1 Interger question i'm stuck!

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

ParsingInts.java
String answerToLife = "42";

1 Answer

Stone Preston
Stone Preston
42,016 Points

int is a primitive type (unlike String which is a class) so the i is lower case.

String answerToLife = "42";
// lowercase i on int, not Int
int answer = Integer.parseInt(answerToLife);

conventionally, primitive types start with lower case letters while classes start with uppercase letters

see the docs on primitive types for more information on the various primitives in Java