✅ Strange error when trying to retrun a class type variable through a public method
Hi there, I am new to C# and while working on this method:
The method public InventoryItem GetNewItem(){} is displaying a build error which says "Inconsistent accessibility: return type 'inventoryitem' is less accessible than method 'GetNewItem()"
I dont understand what it means, the class must be public for later use. Am I doing this wrong?
2 Replies
GetNewItem is public, but InventoryItem is less than public
i.e. it's something like
internal class InventoryItem
or class InventoryItem
instead of public class InventoryItem
im sorry I am struggling to interperet that
give me a moment
ah
ok I see now
thank you very much!