Multiple choice technology platforms and products

A singleton pattern can be achieved by _________________

  1. making all constructors private.

  2. making all constructors public.

  3. removing all constructors.

  4. making all constructor static.

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

The singleton pattern requires a private constructor to prevent external instantiation. This ensures only one instance can exist. Making constructors public would allow multiple instances, violating the singleton principle.