Define class property in one line

Sourav.Kayal
Posted by Sourav.Kayal under C# category on | Points: 40 | Views : 606
using System;
using System.Linq;
using System.Text;
using System.Collections;
using System.Data;
using System.Xml;
using System.IO;
using System.Diagnostics;
using System.Collections.Generic;
namespace BlogProject
{
class Person
{
public string p_Name { get; set; }
}
class Program
{
static void Main(string[] args)
{
Person p = new Person();
p.p_Name = "Sourav";
Console.WriteLine(p.p_Name);
Console.ReadLine();
}
}
}

Comments or Responses

Login to post response