37. set (write) only
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace set_only.cs
{
class clg
{
private string nm;
public string clgnm
{
set { nm = value; }
}
public string clgread
{
get { return nm; }
}
}
class Program
{
static void Main(string[] args)
{
clg obj = new clg();
obj.clgnm = "SSDIIT";
Console.WriteLine("Collage Name : " + obj.clgread);
Console.Read();
}
}
}
OUTPUT :
Collage Name : SSDIIT
Comments
Post a Comment