Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using class as a property?

Tags:

c#

how we can use one class, which is inside into another class as property? i want only theoratical explanation and one small example.

like image 694
MAC Avatar asked Dec 10 '25 15:12

MAC


1 Answers

You mean a nested class used as a type of a property? As long as the access modifier of the property is at most as restrictive as the type of the property, you can do this.

Simply, you should be able to access the type if you can see the property.

like image 179
mmx Avatar answered Dec 12 '25 03:12

mmx



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!