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 trialroboflecto
12,630 PointsCan't figure out what I'm doing wrong when creating exception...
I think I'm doing something wrong when creating the constructor for the TooBigException class.
It keeps telling me this message: "Did you create a constructor for TooBigException that takes a string parameter?"
namespace Treehouse.CodeChallenges
{
class TooBigException : System.Exception
{
public TooBigException(String message) : base(message)
{
}
}
}
1 Answer
Steven Parker
231,236 PointsYou want to take a string (lowercase) parameter, not a String (uppercase S).
They are both valid types, but they are not the same thing.
roboflecto
12,630 Pointsroboflecto
12,630 PointsWow! Thank you very much! Now I'll be aware of it.
Aaahh the little details! It's awesome!
roboflecto
12,630 Pointsroboflecto
12,630 PointsI have investigated a little bit and found that string is an alias in C# for System.String presuming that they are the same type.
Do you know where it is recommended to use each one? Is it better to use a particular one for consistency with your code?