using System;
public class Student
{
private int stdID;
public int StdID
get
return stdID;
}
set
if (stdID < 1)
throw new Exception("student ID should be greater then 0");
else
stdID = value;
public class Program
public static void Main()
Student Aneesh = new Student();
Aneesh.StdID = 25;
Console.WriteLine(Aneesh.StdID);