❔ What does it mean by inaccessible
I'm starting to learn about OOP, I'm wondering why I'm getting this error, what am I doing wrong?
5 Replies
since you didn't include an access modifier when declaring Char's constructor, it defaulted to
private
same for the fields numOfLegs
, rolling
, and material
you need to explicit make it public
public Chair(int L, string M, bool R)
Ah
Thank you very much
also, you should be using properties for public info
not fields
$structure
For C# versions older than 10, see
$StructureOld
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.