Escolar Documentos
Profissional Documentos
Cultura Documentos
Hope this page will help you to understand coding basic of the apex. Here in
this post, I will explain class, datatypes, variables, and constants.
Data types are used to define variables and methods in classes. In Apex, all
variables & expressions have one of the below data types. Those are
● Null (for the null constant. Which can be assigned to any variable.
Map: A collection of unique, primitive keys that map to single values which can
be primitives, sObjects, collections, or Apex objects.
Notes:
– Lists and maps may contain other collections – Collections can only be nested
up to five levels deep.
Static keyword is used to define static variables to store data that is shared
within the class.
– All instances of the same class share a single copy of the static variable.
– This can be a technique used for setting flags to prevent recursive triggers.
Final keyword is used to define constants – this indicates that the variable
can only be assigned once, either in the declaration itself or with a static
initializer method if the constant is defined in the class.