function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
anshuman mishraanshuman 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:-)
sfdcMonkey.comsfdcMonkey.com
hi anshuman mushra
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 :)
farukh sk hdfarukh sk hd
Static variable are global variable which are not related to particular object,You can call a static variable directly by class name without requiring instance of class similar goes for static methods.

For static variable and static method concept in detail visit,
https://www.sfdc-lightning.com/2018/10/static-variable-in-salesforce.html