請有人可以用下面的錯誤幫助:可訪問性不一致:屬性類型是不太容易接近
Inconsistent accessibility: property type 'Test.Delivery' is less accessible than property 'Test.Form1.thelivery'
private Delivery thedelivery;
public Delivery thedelivery
{
get { return thedelivery; }
set { thedelivery = value; }
}
我不能運行程序由於不一致的錯誤消息。
這裏是我的交貨類:
namespace Test
{
class Delivery
{
private string name;
private string address;
private DateTime arrivalTime;
public string Name
{
get { return name; }
set { name = value; }
}
public string Address
{
get { return address; }
set { address = value; }
}
public DateTime ArrivlaTime
{
get { return arrivalTime; }
set { arrivalTime = value; }
}
public string ToString()
{
{ return name + address + arrivalTime.ToString(); }
}
}
}
0down voteaccept 對不起,你能告訴我如何使我的類公共訪問修飾符 –
@DavidBukera:更新,檢查它 –
@DavidBukera:我想你明白了 –