what does singleton provide us means what benefits it gives
i know if i want to make only one instance of the class than that with singleton we can do that
but what else we can do with singleton means its benefits ?
I guess fred had clearly answered you. If you read your question again, you can find the answer in itself.
The very main benefit of using a singleton is to have one AND only instance of a class. This it to avoid too many instances of the same class, wherein the individual instances may NOT make a significant difference in the operations being carried out. This is accomplished by controlling the number of objects/instances being created of that class. A mechanism for achieving this is called Singleton, which is a Design Pattern.
I don't know that there is any benefit from what I have seen. I had a digital display that I was populating and I thought a singleton class might be the answer, but what I realized with help from folks here is that the only reason I would use the singleton at all was because I had designed my program poorly. I didn't want to have to create a new object and manage it with a reference because my program was a mess. Once I cleaned up my program and and made objects less reliant upon one another it was a piece of cake to pass the object reference around where I wanted to use it. It turned out, for me anyway, that it was more of a question of good oo practice than it was about the singleton in particular.
"The greatest of all weaknesses is the fear of appearing weak." - JB Bossuet