【发布时间】:2021-10-03 02:49:23
【问题描述】:
下面给出的代码给出了 b[3] 处无法从 int 转换为字符串的错误
static void Main(string[] args)
{
int[] b = new int[5] { 1, 7, 8, 9, 2 };
Console.WriteLine(b[3],b[4]);
}
而下面给出的代码可以正常工作,没有任何问题
int[] b = new int[5] { 1, 7, 8, 9, 2 };
Console.WriteLine($"{b[3]} {b[4]}");
【问题讨论】: