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 trialsolomon fields
216 Pointshow do i do this
i dont understand i keep getting errors
console.readLine.(the camel-cased version)
2 Answers
Simon Coates
28,694 Pointssomething like:
String firstName = console.readLine("Enter first name");
This retrieves a line from the console with the given prompt, storing the value into the firstName string.
Alejandro Martinez
5,074 Pointstry getting rid of the dot after readLine.. should be console.readLine();
solomon fields
216 Pointsthanks
solomon fields
216 Pointssolomon fields
216 Pointsit keeps saying dont forget to use camel case for first name...i looked it up an according to the internet i am camel casing
Simon Coates
28,694 PointsSimon Coates
28,694 PointsString firstName
defines a variable named firstName with a type of String.
Simon Coates
28,694 PointsSimon Coates
28,694 PointsfirstName is an example of using camel case when naming a variable.
solomon fields
216 Pointssolomon fields
216 Pointsso how do i clear out the error
Simon Coates
28,694 PointsSimon Coates
28,694 PointsReplace the faulty code with the correct code and click on "Recheck work". The code i posted should pass the first part of the challenge.
solomon fields
216 Pointssolomon fields
216 Pointsnope i already replaced it and its been saying the same thing
Simon Coates
28,694 PointsSimon Coates
28,694 PointsYou can start the challenge again, change browsers or clear the browser cache (i avoid doing this as i'm never entirely sure what's in the cache). Then copy and past:
String firstName = console.readLine("Enter first name");
This code passes the first part of the challenge for me. Ie. should work. If you can't get it to accept correct code then maybe send an email (including screenshot) to support.