What is the use of static variable?



What is the use of static variable?..

Answer / Shuchi Gupta

In Salesforce Apex, a static variable is a variable that belongs to a class, not an instance. This means it can be accessed and modified directly by using the class name without creating an object.nnStatic variables are useful when we want to maintain a single value for all instances of the class or when we need to store values that do not change between method calls within the same class.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Salesforce Interview Questions

What is the difference between Trigger and Workflow?

1 Answers  


What is the use of “for update” in soql?

1 Answers  


What is the Apex Trigger in Salesforce?

1 Answers  


What is the use of the <aura:method> tag in lightning ?

1 Answers  


How will you deploy? Have you ever involved in deployment?

1 Answers   Deloitte,


If there is a custom object with records, is it possible to create a field with master-detail relationship for this object?

1 Answers  


What is page layout in salesforce? What are the record types?

1 Answers  


How many soql we can perform per transaction?

1 Answers  


What is the difference between 15 digit and 18 digit ids in salesforce?

1 Answers  


What is json? : salesforce integration

1 Answers  


What is an app in salesforce?

1 Answers  


What is wrapper class?

1 Answers  


Categories