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 trialJohn MacLeod
903 PointsMethod is not recognized
I created the bool method EatFly, but it is not being recognized.
namespace Treehouse.CodeChallenges
{
class Frog
{
public readonly int TongueLength;
public Frog(int tongueLength)
{
TongueLength = tongueLength;
}
bool EatFly(int distanceToFly);
{
}
}
}
1 Answer
Steven Parker
231,248 PointsThe instructions said, "It should return true if the frog can reach the fly with its tongue, and false otherwise.". So you still need to implement the body of the function so it will return the correct result.
Also, there is a stray semicolon at the end of the line defining the method; and the method should be declared "public" as nick suggested.
nick smyth
3,430 Pointsnick smyth
3,430 Pointsmaybe try to make the EatFly class public