C#中的包容是什么 [英] What is Containment in C#

查看:87
本文介绍了C#中的包容是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以向我解释C#中的包容性吗.
我想知道这样的概念,其中一个类包含其他类

或任何有关此概念的好文章的链接都可以提供给我

我在网上甚至在某本书中都对其进行了搜索,但没有得到明确的信息.

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

推荐答案

与C#无关.这是一个基本的面向对象概念,如果您没有解释它的书籍,则需要购买一些.基本上,如果我有一个名为foo的类,并且需要创建一个具有foo某些属性的新类,则可以从foo派生一个类,也可以创建一个其中包含foo的类,并且公开与之交互的方法.这是收容措施.
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.


这篇关于C#中的包容是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆