http://www.c-sharpcorner.com/Forums/Thread/277334/constructor-body.aspxI wish to know whether it is possible to do in the following program the way code is highlighted in the above web page. Problem is coloured.
using System;
public class CreateEmployee
{
public static void Main()
{
int id = 345;
Employee myAssistant = new Employee(id);
Console.WriteLine("ID # is {0}", myAssistant.GetId());
Console.ReadKey();
}
}
internal class Employee
{
private int idNumber;
public Employee(Employee myA)
{
idNumber = myA.idNumber; }
public int GetId()
{
return idNumber;
}
}
// ID # is 345