Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8950

Re: Strange methods behavior

$
0
0

hi Bilal,

 

A static method can be accessed at the class level which means that there is no object/instance required for accessing the method. Static methods/attributes are accessed using the symbol '=>'.

 

To access an instance method, you would require a class object/instance to be available. So instance components exist separately for each instance where as static components exist for each class.

 

Common usage of static attributes/methods are when global data is required that can be accessed across all its instances.

 

Hope that helps,

~Athreya


Viewing all articles
Browse latest Browse all 8950

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>