C
Cool Guy
After the following has been compiled, the number literal values are stored
in a special class field:
class Test {
static void Main() {
int[] arr = new int[] { 1, 2, 3 };
System.Console.WriteLine(arr[0]);
}
}
This is not true for the following, wherein the literal values are included
within the MSIL code for the method:
class Test {
static void Main() {
string[] arr = new string[] { "one", "two", "three" };
System.Console.WriteLine(arr[0]);
}
}
Does anyone know the rationale behind this?
in a special class field:
class Test {
static void Main() {
int[] arr = new int[] { 1, 2, 3 };
System.Console.WriteLine(arr[0]);
}
}
This is not true for the following, wherein the literal values are included
within the MSIL code for the method:
class Test {
static void Main() {
string[] arr = new string[] { "one", "two", "three" };
System.Console.WriteLine(arr[0]);
}
}
Does anyone know the rationale behind this?