Declaring Apex Variables
Because Apex is a strongly-typed language, you must declare data types for all variables before you can reference it in your code. Apex data types include: Integer, Date, Boolean, Lists, Maps, Objects, and sObjects.
Variable Declaration Format: datatype variable_name [ = value ]; The ending semicolon is required! e.g. Integer Count = 0; // variable has a declarative value hard coded e.g. Decimal Total; // variable doesn’t have any assigned value e.g. Account MyAccount = new Account (); // an account-based variable that references the Account sObject












