オブジェクトを初期化するときにはどのようなオプションがありますかstring[]
?
ベストアンサー1
いくつかのオプションがあります:
string[] items = { "Item1", "Item2", "Item3", "Item4" };
string[] items = new string[]
{
"Item1", "Item2", "Item3", "Item4"
};
string[] items = new string[10];
items[0] = "Item1";
items[1] = "Item2"; // ...