我有下面的代码,我正在尝试做一些继承练习,但是当我尝试运行此代码时,它给了我一个错误:
Inconsistent Accessability: Base Class is less accessible than class
编码:
class Program
{
static void Main()
{
FoodProducts Test = new FoodProducts();
Test.Limit();
}
}
public class FoodProducts : Products
{
public void FoodProduct()
{
Console.WriteLine("This is food product");
}
public void Limit()
{
Console.WriteLine("This is an Attribute of a Product");
}
}
有人可以帮助我吗?