Salesforce Advanced Developer

Terms in this set (105)

Inner classes and interfaces can only be declared one level deep inside an outer class.
• Static methods and variables can only be declared in a top-level class definition, not in an inner class.
• Inner classes behave like static Java inner classes, but do not require the static keyword. Inner classes can have instance member
variables like outer classes, but there is no implicit pointer to an instance of the outer class (using the this keyword).
• The private access modifier is the default, and means that the method or variable is accessible only within the Apex class in
which it is defined. If you do not specify an access modifier, the method or variable is private.
• Specifying no access modifier for a method or variable and the private access modifier are synonymous.
• The public access modifier means the method or variable can be used by any Apex in this application or namespace.
93
Classes, Objects, and Interfaces Classes and Collections
• The global access modifier means the method or variable can be used by any Apex code that has access to the class, not just
the Apex code in the same application. This access modifier should be used for any method that needs to be referenced outside of
the application, either in the SOAP API or by other Apex code. If you declare a method or variable as global, you must also declare
the class that contains it as global.
• Methods and classes are final by default.
- The virtual definition modifier allows extension and overrides.
- The override keyword must be used explicitly on methods that override base class methods.
• Interface methods have no modifiers—they are always global.
• Exception classes must extend either exception or another user-defined exception.
- Their names must end with the word exception.
- Exception classes have four implicit constructors that are built-in, although you can add others.
• Classes and interfaces can be defined in triggers and anonymous blocks, but only as local.
;