由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - use the same class name in its declare
相关主题
Java大侠们:Hashtable help please!Runtime.exec() 问题
Apply lock on a class.help on this scope question
问一个关于access object instance的问题A question about inheritance
java class definition and implementation怎么能够减少image上的锯齿?
这道题该走什么路在一个函数里把arraylist设为null 但是有问题
Talk a little more about How to lock a file发现 synchronized 的一个问题
Re: Entity EJB: anyone with real experiencestatic getInstance()
Starter's problemDesign options
相关话题的讨论汇总
话题: manager话题: class话题: usage话题: declare话题: instance
进入Java版参与讨论
1 (共1页)
i**p
发帖数: 902
1
Find a program like this.
public class Manager
{
// construct global manager object on start
public static final Manager INSTANCE = new Manager();
...
}
What is this usage term?
Where can I read the detail for this usage?
thx
u****s
发帖数: 2186
2
singleton

【在 i**p 的大作中提到】
: Find a program like this.
: public class Manager
: {
: // construct global manager object on start
: public static final Manager INSTANCE = new Manager();
: ...
: }
: What is this usage term?
: Where can I read the detail for this usage?
: thx

w*****g
发帖数: 1415
3
因为instance是final,它只能被initialize一次
因为它是static,所有的Manager objects都只能用它
1 (共1页)
进入Java版参与讨论
相关主题
Design options这道题该走什么路
Converge of languages and design patternTalk a little more about How to lock a file
how to print the cllass name of an instance?Re: Entity EJB: anyone with real experience
question about GUIStarter's problem
Java大侠们:Hashtable help please!Runtime.exec() 问题
Apply lock on a class.help on this scope question
问一个关于access object instance的问题A question about inheritance
java class definition and implementation怎么能够减少image上的锯齿?
相关话题的讨论汇总
话题: manager话题: class话题: usage话题: declare话题: instance