Every time I use this._Something
, my this.
is light blue and it has green underline. And I cant get value 101 after F5. Instead, I get value 0. Any help ?
class Student
{
private int _ID;
public void SetID(int Id)
{
if (Id <= 0)
{
throw new Exception("It is not a Valid ID");
this._ID = Id;
}
}
public int GetID()
{
return this._ID;
}
}
class Program
{
public static void Main()
{
Student C1 = new Student();
C1.SetID(101);
Console.WriteLine("Student ID = {0}", C1.GetID());
}
}