Skip to content

Instantly share code, notes, and snippets.

@Teino1978-Corp
Created November 16, 2015 05:36
Show Gist options
  • Save Teino1978-Corp/017f1739b6601ec8391b to your computer and use it in GitHub Desktop.
Save Teino1978-Corp/017f1739b6601ec8391b to your computer and use it in GitHub Desktop.
In this project we will lean about the use of get set property in c#
First we create a class & write the following code:
public class StudentMethod
{
public int Roll { get; set; }
public string Name { get; set; }
}
class Student
{
static void Main(string[] args)
{
StudentMethod std = new StudentMethod();
std.Roll = 1;
std.Name = "Ram";
Console.WriteLine("Roll: {0} and Name: {1}", std.Roll, std.Name);
Console.ReadKey();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment