C# Program Using Get Set Function

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace getset
{
public class information
    {
private string name="John";
public string NAME
        {
get
            {
return name;
            }
set
            {
                name = value;
            }
        }
    }
class Program
    {
static void Main(string[] args)
        {
information stu = new information();
Console.WriteLine("Member is : {0}",stu.NAME);
Console.ReadLine();
        }
    }
}

No comments:

Post a Comment