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 trialGodfrey Adiges
2,146 PointsUncomment 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?
Gloria Dwomoh
13,116 PointsHi Zamy, it will help if you attach your code so we can see that you have done.
Zamy Khan
Courses Plus Student 953 Pointshow would i attach the code sorry?
Gloria Dwomoh
13,116 PointsSince 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.
Zamy Khan
Courses Plus Student 953 Points(String firstName = "Gordon";)
Thats my code i use and it says error
Gloria Dwomoh
13,116 PointsIt 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.
Zamy Khan
Courses Plus Student 953 Points(String firstName = "Gordon";)
i put in this code after erasing the line and still says make sure theres a string defined firstName
Zamy Khan
Courses Plus Student 953 Pointsplease reply to my error i cant get through that stage :/
Gloria Dwomoh
13,116 PointsOh sorry, I totally forgot. Thanks for reminding. Please show me your full code...everything, totally everything. So I can help :)
Zamy Khan
Courses Plus Student 953 PointsString 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 '
Gloria Dwomoh
13,116 PointsWell 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? ");
Zamy Khan
Courses Plus Student 953 PointsYES! thankyou thats exactly what it looks like but it keeps coming up with error :/
Gloria Dwomoh
13,116 PointsPlease can you show a screenshot?
Zamy Khan
Courses Plus Student 953 Pointsnow im having problems with the last one could you show me how the last one should look like
Gloria Dwomoh
13,116 PointsI'll need to see your attempt first and what was the issue in the previous question.
3 Answers
Gloria Dwomoh
13,116 PointsHi 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.
Zamy Khan
Courses Plus Student 953 Pointscould you please show me what it should look like ive attempted it again many times but keeps coming up as syntax error
Gloria Dwomoh
13,116 PointsString band = console.readLine("Which band? ");
Zamy Khan
Courses Plus Student 953 Pointsconsole.readLine = ("Which band?: ")
thats what i typed and says sintax errors
Gloria Dwomoh
13,116 PointsIt'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.
Zamy Khan
Courses Plus Student 953 PointsZamy Khan
Courses Plus Student 953 Pointsfor 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