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
Blake Larson
13,014 PointsBracket errors in compiler?
Not sure why my brackets are red and my leading Class bracket is highlighted red, paired with the end bracket of my final method. I tried to clear all brackets to redo them and still nothing.
3 Answers
Bruno Areias
5,181 PointsHi Blake.
I guess you are missing an (") in:
//ORIGINAL -> System.out.printf(Adding %s %n", song);
System.out.printf("Adding %s \n", song); // <- CORRECT
the (%n) is doing nothing there, if you want to add a next line the correct way is to add a (\n) not a (%n).
ALSO there is a (;) out of place
/* ORIGINAL
Song song = new Song(
"Michael Jackson",
"Beat It";
"https://www.youtube.com/watch?v=SaEC9i9QOvK");
*/
//CORRECT
Song song = new Song(
"Michael Jackson",
"Beat It",
"https://www.youtube.com/watch?v=SaEC9i9QOvK");
Blake Larson
13,014 PointsNope it's there. It has done it on my Karaoke and Song class where there errors are on the bracket lines.
Bruno Areias
5,181 PointsSorry for the edits, was adding stuff as i was reading the code more carefully, the bracket problem should have been because of that (;) out of plase that should be a (,)
Blake Larson
13,014 PointsI might just launch a new workspace and start over because I think its just glitched out. It says I have 9 errors.
Blake Larson
13,014 PointsBlake Larson
13,014 Points