Computer Science, asked by sohana0, 1 year ago

What is a singleton class?

Answers

Answered by KyloRen314
0

In object-oriented programming, a singleton class is a class that can have only one object (an instance of the class) at a time.

After first time, if we try to instantiate the Singleton class, the new variable also points to the first instance created. So whatever modifications we do to any variable inside the class through any instance, it affects the variable of the single instance created and is visible if we access that variable through any variable of that class type defined.

Answered by XxDangerousQueenxX
9

\huge\bold{\pink{Question ♡}}

What is a singleton class?

\huge\bold{\pink{Answer♡}}

Your answer is on Attachment..Have a Look ^_^

Attachments:
Similar questions