0

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

4
Contributors
3
Replies
4
Views
10 Years
Discussion Span
Last Post by peter_budo
0

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.

0

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

Sanjay please do it on your own and return back when you get problem with code, not problem with personal lazines of actualy learning something.

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...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.