Answers for "custom exception c#"

C#
3

custom exception c#

class Student
{
    public int StudentID { get; set; }
    public string StudentName { get; set; }
}

[Serializable]
class InvalidStudentNameException : Exception
{
    public InvalidStudentNameException()
    {

    }

    public InvalidStudentNameException(string name)
        : base(String.Format("Invalid Student Name: {0}", name))
    {

    }
  
}
Posted by: Guest on November-19-2020

Code answers related to "custom exception c#"

C# Answers by Framework

Browse Popular Code Answers by Language