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

C# C# Objects Object-Oriented Programming Initialization

Add a constructor to the Frog class that accepts a tongue length parameter value.

i keep on getting this error Frog.cs(7,16): error CS1520: Class, struct, or interface method must have a return type i don't understand why

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

        public frog(int tonguelength)
        {
            TongueLength = tonguelength;
        }
    }
}

2 Answers

Rune Andreas Nielsen
Rune Andreas Nielsen
5,354 Points

Hi, Benny.

Your constructor name needs to match your class name 100%, it is case sensitive. In your case you wrote "frog" and it should be "Frog" with uppercase 'F' to reflect the name of your class.

thanks