摘要
该文首先介绍了非可变类的概念和优点,然后,依据《Effective Java》提出的非可变类要遵循的五个规则,结合保护性拷贝、对象序列化和类集等技术,重点讨论了在JAVA环境下实现非可变类的方法。
The paper firstly introduces the concept of Immutable Object and its advantages,then,base on five rules given by Effective Java,combine with the technologies of defensive copy,serialization and collection,mainly discusses the implementation of the immutable object with Java.
出处
《电脑知识与技术(过刊)》
2009年第4X期4448-4449,共2页
Computer Knowledge and Technology
关键词
非可变类
保护性拷贝
对象序列化
类集
immutable object
defensive copy
serialization
collection