Reputation: 63
i would like just to get answer to this question, i know it is possible with variables, but with method ?
with a singleton, can i use methods + variables anywhere in my project ?
Thanks.
Upvotes: 0
Views: 64
Reputation: 10275
A singleton is nothing but a global instance of a class. Once you get the instance anywhere on your project, you're supposed to do whatever you want with it, as you would with any other class instance. Obviously, you can access it's public variables and methods.
Upvotes: 1
Reputation: 1742
Yes, you won't have to create an instance to access your singleton method.
Upvotes: 0