|
-
Mar 20th, 2006, 12:23 AM
#1
Thread Starter
New Member
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
-
Mar 20th, 2006, 01:35 AM
#2
Re: Exception class
You have two variables named msg and you're assigning a string to an int variable.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|