Value and Reference
Value and Reference
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VALUE_TYPE_REFERENCE_TYPE
{
class Employee
{
public int Salary;
public int Age;
}
class Program
{
static void Main(string[] args)
{
Employee e = new Employee();
e.Salary = 5000;
e.Age = 23;
Employee e1 = e;
Employee e2 = e;
e.Age = 25;
Console.WriteLine(e.Age);
Console.WriteLine(e1.Age);
Console.WriteLine(e2.Age);
Console.ReadLine();
}
}
}