Click here to Skip to main content
15,896,118 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Can anybody explain me what is containment in C#.
I like to know about the this concept in which one class contains other class

or anybody have link to some good article about this concept can please provide it to me

I searched about it on net or even in some book but didn't get clear information
Posted

1 solution

It has nothing to do with C#. It's a basic OO concept and if you have no books that explain it, you need to buy some. Basically, if I have a class called foo, and I need to create a new class that has some of the attributes of a foo, I can derive a class from foo, or I can create a class that has a foo in it, and exposes methods that interact with it. This is containment.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900