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 trialChris M
592 PointsCreating empty classes
Not sure I understand what to do here.
namespace Treehouse.CodeChallenges
{
class Program
{
static void Main()
{
}
}
}
namespace Treehouse.CodeChallenges
{
}
2 Answers
Seth Kroger
56,413 PointsHere you're asked to start out by declaring a class, We do this by going inside the namespace block and starting with the keyword class
followed by the name of the class, Frog
. Then we use two curly braces to mark the body, or block of the class where all the code for it will go later.
namespace Treehouse.CodeChallenges
{
class Frog
{
}
}
Lisabeta Muresan
Courses Plus Student 230 PointsIn Frog.cs create an empty class named Frog inside the Treehouse.CodeChallenges namespace.
namespace Treehouse.CodeChallenges {
class Program
{
static void Main()
{
class Frog
{
}
}
}
}
NOT WORKING /
Chris M
592 PointsChris M
592 PointsWhoops, was on task 2, the part after this. I should have stated that. In any case, I found an answer you gave to someone else. I didn't know they wanted you to make a variable and save the class to it. That didn't seem very clear to me.
Jennifer Nordell
Treehouse TeacherJennifer Nordell
Treehouse TeacherSeth Kroger is correct (as usual). However, it's important to note that this class must be put in the Frog.cs file and not the Program.cs file.