Multiple choice technology programming languages

What is a singleton?

  1. A class that is instantiated exactly once producing just one object of that class

  2. A complete program that takes up only one line of code

  3. A data structure such as a linked list that contains only one member

  4. None of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The singleton pattern restricts the instantiation of a class to one single instance, ensuring global access to that specific object across the application.