-
Exception class
I'm a newbie to C# I have a question about an exception class. I need to create a exception class called CandyBarException whose constructor receives a string that consists of a candy bar flavor and number of bars. Would this be correct:
public class CandyBarException : ApplicationException
{
private static string msg = "Please pick a different Flavor.";
private static int msg = " You cannot pick more than 3.";
public CandyBarException(string name, int bar)
{
}
}
I don't know if this matters but it is a console program
-
Re: Exception class
You have two variables named msg and you're assigning a string to an int variable.