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 Getting Started with Java IO

how do i do this

i dont understand i keep getting errors

IO.java
console.readLine.(the camel-cased version)

2 Answers

Simon Coates
Simon Coates
28,694 Points

something 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.

it 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
Simon Coates
28,694 Points
String firstName

defines a variable named firstName with a type of String.

Simon Coates
Simon Coates
28,694 Points

firstName is an example of using camel case when naming a variable.

so how do i clear out the error

Simon Coates
Simon Coates
28,694 Points

Replace the faulty code with the correct code and click on "Recheck work". The code i posted should pass the first part of the challenge.

nope i already replaced it and its been saying the same thing

Simon Coates
Simon Coates
28,694 Points

You 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.

Alejandro Martinez
Alejandro Martinez
5,074 Points

try getting rid of the dot after readLine.. should be console.readLine();

thanks