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 trialEnrique Ortiz Figueroa
1,951 PointsAdd a constructor to the Frog class that accepts a tongue length parameter value.
I need some help here...
namespace Treehouse.CodeChallenges
{
class Frog
{
public readonly int TongueLength;
Frog (int TongueLenght)
{
tonguelenght = TongueLenght
}
}
}
10 Answers
Jeremy Hill
29,567 PointsCheck the spelling on your tongueLength variables Make sure that you aren't missing any semi-colons.
David Valentin
7,058 PointsHi, I have similar issue. Not really sure what the error is here as it seems like its correct. No spelling or semicolon issues.
namespace Treehouse.CodeChallenges
{
class Frog
{
public readonly int TongueLength;
Frog(int tongueLength)
{
TongueLength = tongueLength;
}
}
}
Andrew Day
1,389 Pointscomplete code is below
namespace Treehouse.CodeChallenges
{
class Frog
{
public readonly int TongueLength;
public Frog(int tongueLength)
{
TongueLength = tongueLength;
}
}
}
Brianna Ingram
642 PointsThank you very much.
HIDAYATULLAH ARGHANDABI
21,058 Pointsnamespace Treehouse.CodeChallenges { class Frog { public readonly int TongueLength;
public Frog(int tongueLength)
{
TongueLength = tongueLength;
}
}
}
aetienne
1,378 PointsYou didn't put public
public Frog(int tongueLength) { TongueLength = tongueLength; }
Andrei Li
34,475 PointsThe correct answer is:
namespace Treehouse.CodeChallenges
{
class Frog
{
public readonly int TongueLength;
public Frog(int tonguelength)
{
TongueLength = tonguelength;
}
}
}
Cedric Phizeme
Courses Plus Student 956 Pointsnamespace Treehouse.CodeChallenges { class Frog { public readonly int TongueLength; public Frog(int TongueLength) { TongueLength = TongueLength; } } }
Elfar Oliver
3,924 PointsThis was actually right so this shouldn't have any downvotes. Copying that and pressing Enter and Tab just several times was easy. Thank you for the right answer
FHATUWANI Dondry MUVHANGO
17,796 Pointshere is how i did it
namespace Treehouse.CodeChallenges { class Frog { public readonly int TongueLength; public Frog (int tongueLength) { TongueLength = tongueLength;
}
} }
HIDAYATULLAH ARGHANDABI
21,058 Points```namespace Treehouse.CodeChallenges { class Frog { public readonly int TongueLength;
public Frog(int tongueLength)
{
TongueLength = tongueLength;
}
}
}```
Andrew Day
1,389 Pointsput public and check your spelling
FHATUWANI Dondry MUVHANGO
17,796 Pointsi think there is some indentation bug
HIDAYATULLAH ARGHANDABI
21,058 PointsHIDAYATULLAH ARGHANDABI
21,058 Pointscorrect this it will work try public Frog(int tongueLength) {