A Global Singleton is a class of which only one instance exists within a program.

Any attempt to use non-static members of the class involves performing operations on this one instance.




class Singleton
   method print()
       write("Hi there.")
   end
   initially
       write("In constructor!")
       Singleton := create |self
end
 
procedure main()
   Singleton().print()
   Singleton().print()
end