Maha

Maha

  • NA
  • 600
  • 71.5k

Properties and execution bar

Oct 20 2014 4:51 AM
In property programming method, when we use Step Into (F11) key for debugging, execution bar is completing its task within Main() method without going to the class like traditional method. Please explain the reason for that.

using System;
public class CreateStudent
{
public static void Main()
{
Student oneSophomore = new Student();

oneSophomore.Id = 951;
oneSophomore.Name = "Ross";
oneSophomore.GPA = 3.5;

Console.WriteLine
("The student named {0} has ID # is {1} and a gpa of {2}",
oneSophomore.Name, oneSophomore.Id, oneSophomore.GPA);

Console.Read();
}
}
class Student
{
private int idNumber;
private string lastName;
private double gradePointAverage;

public int Id
{
get { return idNumber; }
set { idNumber = value; }
}
public string Name
{
get { return lastName; }
set { lastName = value; }
}
public double GPA
{
get { return gradePointAverage; }
set { gradePointAverage = value; }
}
}
//The student named Ross has ID # is 951 and a gpa of 3.5



Answers (10)