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
Tyron Leworthy
655 PointsAdding Sounds
I am having problems when trying to follow this tutorial. When I enter the following under the animateAnswer method:
private void playSound () {
}
The void has a red underline, when I hover over the red cross on the line number it says: Multiple markers at this line
- syntax error, insert "enum Identifier" to complete EnumHeader
- Syntax error on token "void", @ expected
I have tried again and again, even completing all the text under it in the tutorial but I still get this error. Please help.
4 Answers
Ernest Grzybowski
Treehouse Project ReviewerIf you are simply typing:
private void myMethod(){
}
and getting an error, then you are most likely typing outside of the class. If you paste your entire code I can take a look. Either post it here, or just post a link to a http://pastebin.com.
Tyron Leworthy
655 PointsHere is a link to pastebin, I have copied all the Java code from MainActivity.java
Ben Jakuben
Treehouse TeacherYou are currently defining the playSound() method within the animateAnswer() method. You just need to move it outside that last curly brace that closes the animateAnswer() method.
Tyron Leworthy
655 PointsHaha... now I see it, it looks so obvious!
Thanks