Create a constructor of Car
, and call it:
class Car
{
public string model;
@(6) @(5)
{
model = "Mustang";
}
static void Main(string[] args)
{
@(3) Ford = @(3) @(6)
Console.WriteLine(Ford.model);
}
}
class Car
{
public string model;
public Car()
{
model = "Mustang";
}
static void Main(string[] args)
{
Car Ford = new Car();
Console.WriteLine(Ford.model);
}
}