【发布时间】:2018-02-21 00:18:10
【问题描述】:
当我尝试编译以下代码时,出现 CS0052 错误:
struct mp3
{
public int ID, MBSize;
public string Make, Model, Price;
public mp3(int ID, int voorraad, int MBSize, string Make, string Model, string Price)
{
this.ID = ID;
this.MBSize = MBSize;
this.Make = Make;
this.Model = Model;
this.Price = Price;
}
}
public class Acess
{
static public List<mp3> mp3List = new List<mp3>();
static public void laadMP3()
{
// ...
}
}
错误 1 可访问性不一致:字段类型 'System.Collections.Generic.List' 更少 比字段“SoundSharp___opdracht_3.Acess.mp3List”更容易访问
【问题讨论】:
-
尝试使用一致的方法来访问修饰符,例如始终指定一个(私有、受保护、公共、内部)并始终在行首指定它们。这将有助于将来调试此类问题。
标签: c#