什么是oops中的封装(c#asp.net) [英] what is Encapsulation in oops (c# asp.net)

查看:61
本文介绍了什么是oops中的封装(c#asp.net)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有朋友,请告诉我oops中的封装是什么

dear all friend please tell me what is Encapsulation in oops

推荐答案

Google可以找到比我们更好的解释:http://en.wikipedia.org/wiki/Information_hiding#Encapsulation [ ^ ]或 http ://en.wikipedia.org/wiki/Encapsulation_(object-oriented_programming) [ ^ ]



但基本上,封装是隐藏某个数据/类的实现在另一个类中为了限制和控制对数据的访问。例如,PileOfBooks类可以封装List< Book>保存实际书籍的集合,这样外面的世界只能直接到达堆栈顶部的书本,同时能够访问堆栈本身的任何书本用于其他目的 - 这是一种包含方法,如果说是具体的书是在桩。
Google can find you explanations better than we could give: http://en.wikipedia.org/wiki/Information_hiding#Encapsulation[^] or http://en.wikipedia.org/wiki/Encapsulation_(object-oriented_programming)[^]

But basically, encapsulation is the "hiding" the implementation of some data / class within another class in order to restrict and control the access to the data. For example, a PileOfBooks class may encapsulate the List<Book> collection that holds the actual books so that the outside world can only directly get at the book on the top of the pile, while being able access any book in the stack itself for other purposes - such is a "Contains" method which says if a specific book is in the Pile.


封装是面向对象编程的支柱之一:例如,参见它的维基百科页面 [ ^ ]。
Encapsulation is one of the pillars of Object Oriented Programming: see, for instance, its very Wikipedia page[^].


试试此链接..





try this links..


http://www.tutorialspoint.com/csharp/csharp_encapsulation.htm

http://www.completecsharptutorial.com/basic/encapsulation-abstraction.php

http://www.onlinebuff.com/article_oops-principle-encapsulation-in-c-with-an-example_15.html


这篇关于什么是oops中的封装(c#asp.net)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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