Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

C# C# Objects Methods Method Overloading

Elfar Oliver
Elfar Oliver
3,899 Points

I keep receiving this error: Frog.cs(17,21): error CS0111: A member `Treehouse.CodeChallenges.Frog.EatFly(int, int)' is

I honestly don't understand the problem

Elfar Oliver
Elfar Oliver
3,899 Points

I have no idea why my code isn't there. But I asked for help in the same tab I had the assignment open so when I opened the exercise again I had to redo the whole thing because my code was still up but it didn't fit the criteria for exercise 1 of 3 so I copied and cut the code I couldn't work out and reapplied it and then it just worked. It's done

Elfar Oliver
Elfar Oliver
3,899 Points

namespace Treehouse.CodeChallenges { class Frog { public readonly int TongueLength; public readonly int ReactionTime;

    public Frog(int tongueLength, int reactionTime)
    {
        TongueLength = tongueLength;
        ReactionTime = reactionTime;
    }

    public bool EatFly(int distanceToFly)
    {
        return TongueLength >= distanceToFly;
    }

    public bool EatFly(int distanceToFly,int flyReactionTime)
    {
    return TongueLength >= distanceToFly && ReactionTime <= flyReactionTime;
    }
}

}

Steven Parker
Steven Parker
218,596 Points

If you no longer have a problem, you can click the little rectangle with the 3 dots to reveal the option to "Delete Question".