T
Tony Johansson
Hello!
Here is a simple program that I have used just for this question.
One thing that is strange is when I for example have this statement
Console.WriteLine(car.ToString());
in main. Here for some reason boxing occurs before the ToString method get
called in the root object
I wonder why ?
static void Main(string[] args)
{
Car car = new Car("Test");
Console.WriteLine(car.ToString());
}
public struct Car
{
string name;
public Car(string name)
{
this.name = name;
}
}
//Tony
Here is a simple program that I have used just for this question.
One thing that is strange is when I for example have this statement
Console.WriteLine(car.ToString());
in main. Here for some reason boxing occurs before the ToString method get
called in the root object
I wonder why ?
static void Main(string[] args)
{
Car car = new Car("Test");
Console.WriteLine(car.ToString());
}
public struct Car
{
string name;
public Car(string name)
{
this.name = name;
}
}
//Tony