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 Instantiation

John Holte
John Holte
456 Points

How to create an empty class named Frog inside the Treehouse.CodeChallenges namespace.

Not sure what they are looking for in this test module to:

"In Frog.cs create an empty class named Frog inside the Treehouse.CodeChallenges namespace."?

Program.cs
namespace Treehouse.CodeChallenges
{
    class Program
    {
        static void Main()
        {            

        }
    }
}
Frog.cs
namespace Treehouse.CodeChallenges
{
    public class Frog
    {
        // Empty class
    }
        class Program
    {
        static void Main()
        {
            // Empty class
            var mike ;
            mike = new Frog();
        }
    }
}

2 Answers

Travis Alstrand
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Travis Alstrand
Treehouse Project Reviewer

The question you've posted is from the first challenge in this step, and you actually have the code necessary to pass that one. For step 1, it's only asking to create a class in that file.

Frog.cs

namespace Treehouse.CodeChallenges
{
    public class Frog {

    }
}

For step 2, it looks like you've added the code for this in the Frog.cs file instead of in Program.cs

Create a Frog instance in Program.Main() and assign it to a variable named mike.

Frog.cs

namespace Treehouse.CodeChallenges
{
    public class Frog {

    }
}

Program.cs

namespace Treehouse.CodeChallenges
{
    class Program
    {
        static void Main()
        {            
           Frog mike = new Frog();
        }
    }
}

I hope this makes sense and helps out.

John Holte
John Holte
456 Points

It does & thank you Travis!