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

Kiem Ruach
Kiem Ruach
2,267 Points

C# objects challenge

not sure if i get initializing right. it tells me that i can only initialize in a constructor but thatas what i did

Frog.cs
namespace Treehouse.CodeChallenges
{
    class Frog
    {
        public readonly int TongueLength;
        public readonly int ReactionTime;
        public Frog(int tongueLength)
        {
            TongueLength = tongueLength;

        }

        public bool EatFly(int distanceToFly, int reactionTime)
        {
            return TongueLength >= distanceToFly;
            ReactionTime = reactionTime;

        }
    }
}
Steven Parker
Steven Parker
218,596 Points

It looks like this question was superseded by this other one, see the answers(s) posted there.
You may want to delete this one, click the small rectangle with the 3 dots in it to see the delete option.

Kiem Ruach
Kiem Ruach
2,267 Points

Steven Parker I see you're trying to help me out and thanks. I don't have any questions. I figured out what I was wrong in most of my problems. Just saying thanks and I hope to see you in the future because I will have more questions.

Steven Parker
Steven Parker
218,596 Points

Kiem Ruach — Good to know you have it worked out. You can go to the other question and mark it solved by choosing a "best answer".

And you can still delete this unneeded one.

Kiem Ruach
Kiem Ruach
2,267 Points

@Steven Parker so I ran into an issue that i havent found a way around. Everytime I try to compile or run code in workspace it tells me "no files to compile were specified"

Steven Parker
Steven Parker
218,596 Points

Start a fresh question, make a snapshot of your workspace and post the link to it there, and describe exactly what steps you do to get the error.

And don't forget to mark completed questions as solved, and delete any unneeded questions.