CSharp陷阱1

时间:2022-05-27 14:02:20

CSharp陷阱1

环境:sharpdevelop 3
     .net 2.0

正确的
        internal static readonly string[] string_2 = new string[] { "A", "B"};
        internal static readonly ArrayList arrayList_0 = new ArrayList(string_2);

下面是错误的

internal static readonly ArrayList arrayList_0 = new ArrayList(string_2);
        internal static readonly string[] string_2 = new string[] { "A", "B"};

都能够编译通过。