Would like to know when it is right to uses a nested classes in C#? Do we have incidents in which the use of it is unjustified and therefore not correct?
If you can give examples for both situations Thanks
I find it's convenient to use a nested class when you need to encapsulate a format of data that is primarily going to be used within the parent class. This is usually because the purpose or format of the data is so bespoke to the parent class that it's not really suitable for wider use within your solution.
Here's a simple basic introduction to nested classes.
Nested_Classes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With