Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code that is outside the scope can create another instance of the singleton class even though the requirement was to use only the original instance.Because  Because a singleton instance is associated with the class loader that is used to load it, it is possible to have multiple instances of the same class in the Java Virtual Machine. This situation typically occurs in J2EE containers and applets. Technically, these instances are different classes that are independent of each other. Failure to protect against multiple instances of the singleton may or may not be insecure depending on the specific requirements of the program.

...