Apex data types
Each variable in Apex has a data type. This can be a primitive data type (such as String, Decimal, and so on), an sObject, an enum, an Apex class, or a collection of these types.
The following table will give you an overview of all the different variable types you can use in Apex:
|
Blob |
Binary data is being stored as a single object. By using the toString() or valueOf() methods, you can convert this data type to a string. Examples of a blob are web service arguments, the content of a document, and attachments. |
|
Boolean |
A value that can correspond to a checkbox. The value can only be true, false, or null. |
|
Date |
A variable that contains a day as a value. Date values must initiate the system static method (Date.newInstance(Year, ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access