Inconsistent Accessability: Base Class is less accessible than class

c#, inheritance

Solution

Just for future reference for someone thick like me, I got this in the following situation and couldn't figure out what was going wrong:

public class Foo : Base<Bar> {} <-- Inconsistent accessibility

public class Base<T> {}

It took me a while to work out that the culprit was here:

internal class Bar {}

Problem

I've got the code below and I'm trying to do some inheritance exercises but when I try to run this code it gives me an error: ``` Inconsistent Accessability: Base Class is less accessible than class ``` The code: ``` 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"); } } ``` Would someone be able to help me?

Original source

Related problems