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 trialVarun Kashyap Kuturu
17,963 PointsCreate a Frog instance in Program.Main() and assign it to a variable named mike.
i couldn't figure out this
namespace Treehouse.CodeChallenges
{
class Program
{
static void Main()
{
Frog mike = new Frog(mike) ;
}
}
}
namespace Treehouse.CodeChallenges
{
class Frog
{
public string name;
{name = name;}
}
}
5 Answers
Seth Kroger
56,413 PointsThe first part of the challenge is just to create an empty class named Frog, so it doesn't need any names or fields.
class Frog {}
Then when you're asked to create a new one, you make a new frog without passing any arguments like this:
Frog mike = new Frog();
// or
var mike = new Frog();
Richard Wood
1,990 Pointshmm. I had this exact answer typed but it didn't work.? Then I tried to copy & paste directly in. Still no good. I'm tempted to believe there may be some error?
namespace Treehouse.CodeChallenges { class Frog { } } ***Update* I just reset the code. It seemed to fix the problem.
Brennan Grout
Full Stack JavaScript Techdegree Student 5,879 PointsMake sure you are in the "Program.cs"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Just spent way too long typing Frog and mike...
Tafadzwa Chiroro
8,188 PointsI'm so sure that what im doing is correct but still having this problem. how to pass it!
Pedro Suarez
993 Pointsalso spaces do count so make sure just to leave one space at most otherwise the code will not work
Fradely Dilone
24,037 PointsFROG.CS
namespace Treehouse.CodeChallenges { class Frog{
}
}
PROGRAM.CS
namespace Treehouse.CodeChallenges
{
class Program
{
static void Main()
{
var mike = new Frog();
}
}
}
Milton Vasquez
6,818 PointsMilton Vasquez
6,818 Pointstry with this,
Frog mike = new Frog(); it worked for me.