| | |
singleton
![]() |
Make its constructor private and have a static method called instance(), inside this method create a instance only once , and return the same instance everytime this static method is called.
•
•
•
•
write a sample code to create singleton class using java. ensure that only one instance will be creted and same will be returned always.
please do it.
sanjay
Important thing is to read forums rules befor signing up for the forum. This forum doesn't provide solution to courseworks/assignments/project works. We help individuals which want to learn. Copy & paste somebody's work and put your signature bellow it is not our way of helping. If you want somebody else to do your work find other forum, but you will be charged for it...
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
![]() |
Similar Threads
- Singleton class Worked example (C++)
- singleton class with example....... (C++)
- C++ Performance Tips (C++)
- Which is worse? (Java)
Other Threads in the Java Forum
- Previous Thread: CubicCurve2D doubt
- Next Thread: Inserting Audio clip
| Thread Tools | Search this Thread |
911 actionlistener addressbook android api append applet application array arrays automation binary blackberry block bluetooth character chat class client code component consumer csv database desktop developmenthelp eclipse error fractal ftp game givemetehcodez graphics gui html ide image integer j2me j2seprojects japplet java javaarraylist javac javaee javaprojects jni jpanel julia lego linked linux list loops mac map method methods mobile netbeans newbie number objects online oriented panel printf problem program programming project projects properties recursion replaydirector reporting researchinmotion rotatetext rsa scanner se server set singleton sms sort sql string swing test textfields threads time title tree tutorial-sample ubuntu update windows working






