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 trialBryce Linch
7,495 PointsCompiler errors, WHY!?!?!?!
Frog.cs(10,12): error CS1525: Unexpected symbol public'
Frog.cs(10,30): error CS1525: Unexpected symbol
('
Frog.cs(17,0): error CS1525: Unexpected symbol `}'
Compilation failed: 3 error(s), 0 warnings
These are my errors, and I don't understand why, everything looks similar to how he demonstrated it in the video
namespace Treehouse.CodeChallenges
{
class Frog
{
public readonly int TongueLength;
public Frog(int tongueLength)
{
TongueLength = tongueLength;
public bool EatFly(int distanceToFly)
{
bool getIt = distanceToFly < TongueLength;
return getIt;
}
}
}
}
2 Answers
Steven Parker
231,248 PointsIt looks like you placed your method inside the constructor method.
Just move it to right after the constructor and you should be in good shape!
Bryce Linch
7,495 PointsOh I put it inside the Frog method, not the Frog class, got it, Thank you!