Created
November 16, 2015 05:36
-
-
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#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
First we create a class & write the following code: | |
public class StudentMethod | |
{ | |
public int Roll { get; set; } | |
public string Name { get; set; } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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