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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Roger Sullivan](https://secure.gravatar.com/avatar/891c10304f9af6d3972992806711439f?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Roger Sullivan
10,992 Pointsit's throwing no errors and my only clue is "Bummer! try again" so i assume i'm completely off base.
is this not how you initialize the object with a value?
namespace Treehouse.CodeChallenges
{
class Frog
{
public readonly int TongueLength;
public Frog (int tongueLength)
{
int TongueLength = tongueLength;
}
Frog frog = new Frog(3);
}
}
1 Answer
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,688 Points It looks like you are creating a new local variable named TongueLength inside the constructor, instead of initializing the property of the same name that you have already defined. That's not an error to the compiler, it just doesn't do what the challenge asked for.
So, instead of this:
int TongueLength = tongueLength;
Just do this:
TongueLength = tongueLength;
And remove this line, it's not part of the challenge:
Frog frog = new Frog(3);
-sp
Roger Sullivan
10,992 PointsRoger Sullivan
10,992 Pointsit will accept the line that you are telling me to change. Third step "Add a constructor to the Frog class that accepts a tongue length parameter value." is what i am trying to achieve? is the line your telling me to remove not meant to do that?
Steven Parker
230,688 PointsSteven Parker
230,688 PointsYou obviously passed task 2 already, perhaps you didn't realize that the "constructor ... that accepts a tongue length parameter value" is this part:
That extra line would create an instance of this class and name it frog. That's certainly not something you would do inside the class itself.
Roger Sullivan
10,992 PointsRoger Sullivan
10,992 Pointsapparently was doing the third step with the second. thank you for your help!