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 Using your New Tools Coding the Prototype

Godfrey Adiges
Godfrey Adiges
2,146 Points

Uncomment the first line and fix the error. If you do not see the error, click submit and view the Preview pane to view

What errors are there on this exercise?

for the first one ive done String firstName = "Gordon"; but when i check it keeps saying 'make sure you have fixed the first line by defining a String named firstName. Please help

Hi Zamy, it will help if you attach your code so we can see that you have done.

how would i attach the code sorry?

Since you are not creating a new question. You just have to copy paste your code and mark it down so it appears as a code instead of plain text. To see how to do that either check the video on the right under "Tips for asking questions", check the Markdown Cheatsheet which is located above the "Post comment" button whenever you reply someone or read Posting code to the forum.

(String firstName = "Gordon";)

Thats my code i use and it says error

It supposed to be "String" not... "Srting" and also you don't have to create a new line, you have to uncomment the commented line and correct it.

(String firstName = "Gordon";)

i put in this code after erasing the line and still says make sure theres a string defined firstName

please reply to my error i cant get through that stage :/

Oh sorry, I totally forgot. Thanks for reminding. Please show me your full code...everything, totally everything. So I can help :)

String firstName = "Gordon";

haha its okay! i typed in this when it says umcomment first line so i erased the first line and changed it to this the only problem in the first like was the spelling of string and that its but i changed that and clicked check but it says 'make sure theres a string defind firstName' which i dont get '

Well if it is what you are telling me then that is correct.

Does your full code looks like this?

String firstName = "Gordon";

// string lastName = "Sumner";

// console.printf("Hello %s", firstName)

// band = console.readLine("Which band?  ");

YES! thankyou thats exactly what it looks like but it keeps coming up with error :/

Please can you show a screenshot?

now im having problems with the last one could you show me how the last one should look like

I'll need to see your attempt first and what was the issue in the previous question.

3 Answers

Hi Godfrey, that challenge give you some lines of code that are commented. It wants you to "uncomment" a line at a time and correct the error it has if you think it has an error (and submit it) or click "submit" straight away, if you think there is no error in that line. Preview pane as it says allows you to view things like errors so if you get an error you can click that in order to see what error message the preview pane shows you have got.

could you please show me what it should look like ive attempted it again many times but keeps coming up as syntax error

String band = console.readLine("Which band?  ");

console.readLine = ("Which band?: ")

thats what i typed and says sintax errors

It's because that is wrong. That part of the code is totally right. The thing that is missing is the declaration. If you notice this code

// band = console.readLine("Which band?  ");

there is no declaration. So it wants you to add that :) the rest is correct.