You need to sign in to do that
Don't have an account?

When to use static method/variable and when to not?
What is the advatages of using static method/variables beside of it can be call even not instantiating the class where they reside?
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
What is the advatages of using static method/variables beside of it can be call even not instantiating the class where they reside?
There is a great book out called 'Advanced Apex Programming' by Dan Appleman that devotes a whole chapter to static techniques. The are useful in maintaining data across trigger calls, caching data, controlling program flow.
For static variable and static method concept in detail visit,
https://www.sfdc-lightning.com/2018/10/static-variable-in-salesforce.html