面向对象的封装性在JAVA中的具体实现  

The Implementation of Object-oriented Encapsulation in JAVA

在线阅读下载全文

作  者:彭泽赛 虞蕊萌 PENG Zesai;YU Ruimeng(Yunnan Vocational Institute of Energy Technology,Qujing Yunnan 655001,China)

机构地区:[1]云南能源职业技术学院,云南曲靖655001

出  处:《信息与电脑》2024年第14期77-79,共3页Information & Computer

摘  要:在面向对象的思想中,封装就是对本类以外的程序隐藏信息,可以认为是一个保护屏障。同时,面向对象是将问题分解为多个独立的对象来处理的编程范式。而封装是面向对象设计的核心,用于保护对象的属性和方法不被无约束地访问或修改。封装的体现包括使用private关键字修饰成员变量,并通过public方法设置值。文本首先讨论了面向对象的基本思想、封装的重要性,然后对封装的使用场景、实施过程以及封装后私有化信息的访问方式进行了详细地阐述,并用JAVA实例逐一进行了演示,为其他研究者提供参考。In the concept of object-oriented programming,encapsulation is the act of hiding information from programs outside of its own class,and can be considered a protective barrier.Meanwhile,object-oriented programming is a paradigm that decomposes problems into multiple independent objects for processing.Encapsulation is the core of object-oriented design,used to protect the properties and methods of objects from being accessed or modified without constraints.The manifestation of encapsulation includes using the private keyword to modify member variables and setting values through public methods.The text first discusses the basic ideas of object-oriented programming and the importance of encapsulation,and then elaborates in detail on the usage scenarios,implementation process,and access methods of private information after encapsulation.JAVA examples are used to demonstrate each one,providing references for other researchers.

关 键 词:封装性 私有化 访问方式 

分 类 号:TP393[自动化与计算机技术—计算机应用技术]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象