36. Get (READ) only properties
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace only_get.cs
{
class get
{
public string Get
{
get { return "Milan"; }
}
}
class Program
{
static void Main(string[] args)
{
get obj = new get();
Console.WriteLine("Name = " + obj.Get);
Console.Read();
}
}
}
OUTOUT:
Name = Milan
Comments
Post a Comment