标题:JAVA中的让类成为singleton是什么意思?
取消只看楼主
hqsiswiliam
Rank: 1
等 级:新手上路
帖 子:5
专家分:5
注 册:2011-11-18
结帖率:100%
已结贴  问题点数:10 回复次数:1 
JAVA中的让类成为singleton是什么意思?
A singleton is simply a class that is instantiated exactly once. Singletons typically represent a system component that is intrinsically unique, such as the window manager or file system. Making a class a singleton can make it difficult to test its clients, as it’s impossible to substitute a mock implementation for a singleton unless it implements an interface that serves as its type.

表示不理解啊。。
搜索更多相关主题的帖子: substitute difficult interface represent exactly 
2011-11-18 11:45
hqsiswiliam
Rank: 1
等 级:新手上路
帖 子:5
专家分:5
注 册:2011-11-18
得分:0 
回复 2楼 lampeter123
singleton如何向整个系统提供实例?
2011-11-22 07:11



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-355577-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.069157 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved