You need to sign in to do that
Don't have an account?
anshuman mishra
When is static variable use.Whats the "static" part about it?
I came accross this statement in apex guide about static variables:
A static variable is static only within the scope of the Apex transaction. It’s not static across the server or the entire organization. The
value of a static variable persists within the context of a single transaction and is reset across transaction boundaries. For example, if an
Apex DML request causes a trigger to fire multiple times, the static variables persist across these trigger invocations.
My question is,what is the static part mean in static variable?Is it that during one transaction or one operation,its value remains the same and cannot be changed.I am new so would appreciate a clarification.Thanks:-)
A static variable is static only within the scope of the Apex transaction. It’s not static across the server or the entire organization. The
value of a static variable persists within the context of a single transaction and is reset across transaction boundaries. For example, if an
Apex DML request causes a trigger to fire multiple times, the static variables persist across these trigger invocations.
My question is,what is the static part mean in static variable?Is it that during one transaction or one operation,its value remains the same and cannot be changed.I am new so would appreciate a clarification.Thanks:-)
go to below link for better understand static variable use in apex
http://www.jitendrazaa.com/blog/java/static-block-static-variable-and-static-method/
thanks
let me inform if my answer helps you :)
For static variable and static method concept in detail visit,
https://www.sfdc-lightning.com/2018/10/static-variable-in-salesforce.html